2014-04-01 53 views
0

我想从一个位置的一个目录复制到另一个,但在拷贝我收到一条错误消息:如何复制目录?

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)) 

但我仍然得到同样的信息。

任何关于如何解决这个问题的指针?

谢谢。

+0

为什么你连接一个文件名到CURDIR变量你可以尝试使用

Process.StartInfo.Filename = "xcopy" Process.StartInfo.Arguments = String.Format("{0} {1} {2}", sourcedir, destdir, xcopyflags) Process.Start() 

? CopyDirectory的第二个参数应该是另一个文件夹 – Steve

回答

0

如果你不知道的标志或使用的,你可以打开一个命令提示符,然后输入

xcopy /?