System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = fileName;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.WaitForExit();
var error = proc.StandardError.ReadToEnd();
proc.WaitForExit();
var output = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
No comments:
Post a Comment