Hey I am trying to get the output from an external console program.
Does anyone know how to do this. For example i want to be able to do what VS.NET does when it shows the compiler output.
Thanks
Printable View
Hey I am trying to get the output from an external console program.
Does anyone know how to do this. For example i want to be able to do what VS.NET does when it shows the compiler output.
Thanks
If you start the app from the Process class, you have access to the standard in/out/and err streams.
Cheers, found what i was looking for instantly. Suppose you need to know what to look for first :blush: :lol:
One more thing, i found this code to hide the process which is being called. It works fine but it doesn't hide the window
Code:Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "test.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.CreateNoWindow = true;
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
this.textBox1.Text = (string)output;