|
 | | |
| Autor | Správa |
psm
 Užívateľ
 Založený: 06.11.2009 Príspevky: 72
 | Zaslal: Po 22.03.10 11:20 |   |
Caute, vedel by mi niekto poradit ako premiestnit subor z jedneho adresara do druheho? Pouzivam programovaci jazyk c++/cli a nasiel som na nete iba tento zdrojovy kod, ktory ale sluzi iba na premiestnenie presne definovanych suborov. Dakujem
| kód: | #
int main()
#
{
#
Watcher::run();
#
#
String^ path = "C:\\way\\";
#
String^ path2 = "C:\\way\\";
#
try
#
{
#
#
// Ensure that the target does not exist.
#
if ( File::Exists( path2 ) )
#
File::Delete( path2 );
#
#
// Move the file.
#
File::Move( path, path2 );
#
Console::WriteLine( "Súbor {0} bol premiestnený do {1}.", path, path2 );
#
#
// See if the original exists now.
#
if ( File::Exists( path ) )
#
{
#
Console::WriteLine( "Originálny súbor ešte stále existuje." );
#
}
#
else
#
{
#
Console::WriteLine( "Originálny súbor už neexistuje" );
#
}
#
}
#
catch ( Exception^ e )
#
{
#
Console::WriteLine( "Proces zlyhal: {0}", e );
#
}
#
} |
|
| |
  |
 |
|
Nemôžete pridávať nové témy do tohto fóra. Nemôžete odpovedať na témy v tomto fóre. Nemôžete upravovať svoje príspevky v tomto fóre. Nemôžete mazať svoje príspevky v tomto fóre. Nemôžete hlasovať v tomto fóre.
|
| |