我正在尝试从c ++程序的.exe文件中读取输出并尝试使用此输出在我的asp.net Web应用程序中进一步使用但它不起作用 这就是我到目前为止所做的事情
System.Diagnostics.Process MyProcess = new System.Diagnostics.Process();
MyProcess.StartInfo.CreateNoWindow = true;
MyProcess.StartInfo.UseShellExecute = false;
MyProcess.StartInfo.RedirectStandardOutput = true;
MyProcess.StartInfo.WorkingDirectory = "C:\\Users\\Hussain\\Documents";
MyProcess.StartInfo.FileName = "demo.exe";
MyProcess.StartInfo.Arguments = "MyArgument";
MyProcess.Start();
String s = MyProcess.StandardOutput.ReadToEnd();
System.IO.StreamWriter file = new
System.IO.StreamWriter("C:\\Users\\Hussain\\Documents\\123.txt");
file.WriteLine(s);
file.Close();
MyProcess.WaitForExit();
MyProcess.Close();