[英]How do I copy a directory?
我想将一个目录从一个位置复制到另一个位置,但是在复制时出现错误消息:
“ Could not complete operation on some files and directories. See the Data property of the exception for more details.
“我不知道是什么问题
我试过了:
Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(FolderBrowserDialog1.SelectedPath, System.IO.Path.Combine(curDir, filename.Name))
和
My.Computer.FileSystem.CopyDirectory(FolderBrowserDialog1.SelectedPath, System.IO.Path.Combine(curDir, filename.Name))
但是我仍然收到同样的信息。
关于如何解决这个问题的任何指示?
谢谢。
您可以尝试使用
Process.StartInfo.Filename = "xcopy"
Process.StartInfo.Arguments = String.Format("{0} {1} {2}", sourcedir, destdir, xcopyflags)
Process.Start()
如果不确定标志或用法,可以打开命令提示符并键入
xcopy /?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.