2014-04-01 56 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 /?