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

后端 未结 7 964
误落风尘
误落风尘 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:59

    You can also p/invoke SHFileOperation which is the same function Windows Explorer uses to move directories around. It will either perform a true move or recursive-copy-then-delete, as appropriate.

    It can also show the same progress UI as explorer, just by setting a flag.

提交回复
热议问题