G
Guest
I do not understand how this function should work. It seems to be different than when I drag a folder ...
error message: Cannot create a file when that file already exists.
c:\atest has subfolder btest which has subfolder ctest plus a single file.
( c:\atest\btest\ctest\test.txt )
c:\aatest is an empty folder.
If I drag atest to aatest, I will have c:\aatest\atest\btest\ctest\test.txt
But as noted using the function as below wont work.
So conceptually I am mixed up, how should I think about this function, Thanks !!!
try
{
string sorDir=@"c:\atest";
string desDir=@"c:\aatest";
if ((Directory.Exists(sorDir)==true) && (Directory.Exists(desDir)==true))
{
Directory.Move(sorDir,desDir);
}
}
catch ( Exception e )
{
Console.WriteLine("What now : " + e.Message);
}
error message: Cannot create a file when that file already exists.
c:\atest has subfolder btest which has subfolder ctest plus a single file.
( c:\atest\btest\ctest\test.txt )
c:\aatest is an empty folder.
If I drag atest to aatest, I will have c:\aatest\atest\btest\ctest\test.txt
But as noted using the function as below wont work.
So conceptually I am mixed up, how should I think about this function, Thanks !!!
try
{
string sorDir=@"c:\atest";
string desDir=@"c:\aatest";
if ((Directory.Exists(sorDir)==true) && (Directory.Exists(desDir)==true))
{
Directory.Move(sorDir,desDir);
}
}
catch ( Exception e )
{
Console.WriteLine("What now : " + e.Message);
}