我正在將文件從一個文件夾移動到另一個文件夾。如果我嘗試將整個文件夾移動到該特定文件夾內的文件夾,我無法做到這一點。但如果我將它移到外面,它工作正常。如何將我的文件夾移動到該文件夾內的文件夾?c#文件移動(文件已被其他進程使用)
這給了錯誤
if (System.IO.Directory.Exists(PhysicalPath))
{
string sourcePath = "c:\\copypath\\";
string targetPath = "c:\\copypath\\abc\\";
System.IO.Directory.Move(sourcePath, targetPath);
}
這工作得很好
if (System.IO.Directory.Exists(PhysicalPath))
{
string sourcePath = "c:\\copypath\\";
string targetPath = "c:\\abc\\";
System.IO.Directory.Move(sourcePath, targetPath);
}
所以你想在你的文件夾中的文件夾,所以你可以文件夾,而你的文件夾? – TJHeuvel 2011-04-12 10:05:27
「這給出錯誤」:什麼樣的錯誤? – khachik 2011-04-12 10:09:03