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



On 12/13/2006 11:23 AM, kellygreer1 wrote:
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 kellygreer@xxxxxxxxxx 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
.



Relevant Pages

  • How do I capture the output of a command line app in .NET?
    ... I know I can execute another app using ... But how do I execute an app where I expect output and capture that ... change nospam to yahoo ...
    (microsoft.public.dotnet.framework)
  • Re: Sound recording - HELP!
    ... maybe this would be a great app to get my ... listing on the radio. ... Private Sub StartRecording() ... mciSimpleSendString("open new type waveaudio alias capture") ...
    (microsoft.public.dotnet.languages.vb)
  • Requested Registry Access is Not Allowed
    ... We have several applications that will be executing on multiple machines. ... will execute the apps. ... There are Permission Sets within the framework configuration tool, ... The app fails on the WriteEntry and the exception that is thrown is ...
    (microsoft.public.dotnet.framework)
  • RE: Requested Registry Access is Not Allowed
    ... > We have several applications that will be executing on multiple machines. ... > will execute the apps. ... > There are Permission Sets within the framework configuration tool, ... > machine that the app will run. ...
    (microsoft.public.dotnet.framework)
  • RE: Strange behavior of redirected stdout. Streams Broken?
    ... I can capture stderr and stdout from a console app. ...
    (microsoft.public.dotnet.general)