I can't move files from disk C: to D:
From C: to C: is working, but only this it's not enough.
Exception Message: The source path and the destination path must have the same root. The drive will not work between volumes.
I trying this
public class Tests
{
public static void MoveFiles(string tarjet, string destiny)
{
var files = new DirectoryInfo(tarjet).GetFiles();
var directories = new DirectoryInfo(tarjet).GetDirectories();
foreach (var d in directories)
{
Directory.Move(d.FullName, Path.Combine(destiny, d.Name));
}
foreach (var f in files)
{
File.Move(f.FullName, Path.Combine(destiny, f.Name));
}
}
}