对于像这样的 C# 控制台应用程序,使用 xcopy 还是 robocopy 更好?另外, xcopy 是否会暂停直到复制完成?
// copy web project to temp
Process proc = new Process();
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.FileName = @"C:\WINDOWS\system32\xcopy.exe";
//proc.StartInfo.Arguments = @"C:\Users\Aron\Pictures\sql-help C:\temp\633965882226105579 /E /I";
proc.StartInfo.Arguments = string.Format("{0} {1} /E /I", TemplateDemoSiteFolder, SitePath);
proc.Start();
Thread.Sleep(9000); // pause for 9 seconds -not very safe though