Gets the line of characters that was written to a redirected System.Diagnostics.Process output stream.
Documentation for this section has not yet been entered.
When you redirect the Process.StandardOutput or Process.StandardError stream of a System.Diagnostics.Process to your event handler, an event is raised each time the process writes a line to the redirected stream. The DataReceivedEventArgs.Data property is the line that the System.Diagnostics.Process wrote to the redirected output stream. Your event handler can use the DataReceivedEventArgs.Data property to filter process output or write output to an alternate location. For example, you might create an event handler that stores all error output lines into a designated error log file.
A line is defined as a sequence of characters followed by a line feed ("\n") or a carriage return immediately followed by a line feed ("\r\n"). The line characters are encoded using the default system ANSI code page. The DataReceivedEventArgs.Data property does not include the terminating carriage return or line feed.
When the redirected stream is closed, a null line is sent to the event handler. Ensure your event handler checks the DataReceivedEventArgs.Data property appropriately before accessing it. For example, you can use the static method string.IsNullOrEmpty(string) to validate the DataReceivedEventArgs.Data property in your event handler.