Begins asynchronous read operations on the redirected Process.StandardError stream of the application.
The Process.StandardError stream can be read synchronously or asynchronously. Methods such as System.IO.StreamReader.Read, System.IO.StreamReader.ReadLine, and System.IO.StreamReader.ReadToEnd perform synchronous read operations on the error output stream of the process. These synchronous read operations do not complete until the associated System.Diagnostics.Process writes to its Process.StandardError stream, or closes the stream.
In contrast, Process.BeginErrorReadLine starts asynchronous read operations on the Process.StandardError stream. This method enables the designated event handler for the stream output and immediately returns to the caller, which can perform other work while the stream output is directed to the event handler.
Follow these steps to perform asynchronous read operations on Process.StandardError for a System.Diagnostics.Process :
[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]When asynchronous read operations start, the event handler is called each time the associated System.Diagnostics.Process writes a line of text to its Process.StandardError stream.
You can cancel an asynchronous read operation by calling Process.CancelErrorRead. The read operation can be canceled by the caller or by the event handler. After canceling, you can call Process.BeginErrorReadLine again to resume asynchronous read operations.
You cannot mix asynchronous and synchronous read operations on a redirected stream. Once the redirected stream of a System.Diagnostics.Process is opened in either asynchronous or synchronous mode, all further read operations on that stream must be in the same mode. For example, do not follow Process.BeginErrorReadLine with a call to System.IO.StreamReader.ReadLine on the Process.StandardError stream, or vice versa. However, you can read two different streams in different modes. For example, you can call Process.BeginErrorReadLine and then call System.IO.StreamReader.ReadLine for the Process.StandardOutput stream.