簡體   English   中英

如何復制目錄?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM