如何获取一个控制台程序的输出信息

如题所述

Process p = new Process();
p.StartInfo.FileName = @"";//控制台程序的路径
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.Start();

p.StandardInput.WriteLine("");
p.StandardOutput.ReadLine();
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答