“Move will not work across volumes” - Why? And how to overcome?

后端 未结 7 959
误落风尘
误落风尘 2020-12-06 10:19

Why is it that File.Move(sourceFileName, destFileName) works fine when the source file and destination files are in different partitions, but Directory.Mo

7条回答
  •  鱼传尺愫
    2020-12-06 10:58

    Although this is not a Vb.Net question but I found no one mentioned this method so I think might help... Only you need to convert it to C# if needed.

    Code:

    My.Computer.FileSystem.MoveDirectory(SrcDir,DestDir) 
    

    This works on different volume seamlessly/ per my experience.

提交回复
热议问题