Occurs when an application writes to its redirected StandardError stream.
Assembly: System (in System.dll)
The event indicates that the associated process has written to its redirected StandardError stream.
The event only occurs during asynchronous read operations on StandardError. To start asynchronous read operations, you must redirect the StandardError stream of a Process, add your event handler to the event, and call BeginErrorReadLine. Thereafter, the event signals each time the process writes a line to the redirected StandardError stream, until the process exits or calls CancelErrorRead.
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 uses the net view command to list the available network resources on a remote computer. The user supplies the target computer name as a command-line argument. The user can also supply a file name for error output. The example collects the output of the net command, waits for the process to finish, and then writes the output results to the console. If the user supplies the optional error file, the example writes errors to the file.
for full trust for the immediate caller. This member cannot be used by partially trusted code.