【发布时间】:2013-03-27 02:33:09
【问题描述】:
我正在执行如下命令提示符命令:
string cmd = "/c dir" ;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = cmd;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
如何获取命令的输出?
【问题讨论】:
标签: c# shell command output prompt