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

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
 
S

Samik R.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top