How do I capture the output of a command line app in .NET?

  • Thread starter Thread starter kellygreer1
  • Start date Start date
K

kellygreer1

I know I can execute another app using
System.Diagnostics.Process.Start.
But how do I execute an app where I expect output and capture that
output in a String variable inside of .NET?

Thanks in advance,
Kelly Greer
(e-mail address removed)
change nospam to yahoo
 
I know I can execute another app using
System.Diagnostics.Process.Start.
But how do I execute an app where I expect output and capture that
output in a String variable inside of .NET?

Thanks in advance,
Kelly Greer
(e-mail address removed)
change nospam to yahoo
You can use the BeginOutputReadLine method on the Process, which will
read the line one by one just like a stream. Then you can process the
line as you like.

HTH.
-Samik
 
Back
Top