Occurs each time an application writes a line to its redirected StandardOutput stream.
Assembly: System (in System.dll)
The event is enabled during asynchronous read operations on StandardOutput. To start asynchronous read operations, you must redirect the StandardOutput stream of a Process, add your event handler to the event, and call BeginOutputReadLine. Thereafter, the event signals each time the process writes a line to the redirected StandardOutput stream, until the process exits or calls CancelOutputRead.
The application that is processing the asynchronous output should call the WaitForExit method to ensure that the output buffer has been flushed.
The following example illustrates how to perform asynchronous read operations on the redirected StandardOutput stream of the ipconfig command.
The example creates an event delegate for the OutputHandler event handler and associates it with the event. The event handler receives text lines from the redirected StandardOutput stream, formats the text, and saves it in an output string that’s later shown in the example’s console window.
for full trust for the immediate caller. This member cannot be used by partially trusted code.
Available since 2.0