How to create a process and get the return code

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi

I need to call a win32 application from windows form and get the return code
from the win32 application. How can I do this?


Thanks
 
That's right, take a look at the process class:
http://tinyurl.com/2j73y

Process.StandardOutput Property
http://tinyurl.com/2a36b.
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "test.exe";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
 
Back
Top