📜  c#执行shell命令 - C#代码示例

📅  最后修改于: 2022-03-11 14:49:04.401000             🧑  作者: Mango

代码示例3
System.Diagnostics.ProcessStartInfo process = new System.Diagnostics.ProcessStartInfo();
process.UseShellExecute = false;
process.WorkingDirectory = worikng_path;
process.FileName = command;
process.Arguments = command_arguments;
process.RedirectStandardOutput = true;

System.Diagnostics.Process cmd =  System.Diagnostics.Process.Start(process);
// waiting to complete 
cmd.WaitForExit();