Process.ReadAllLines(Nullable<TimeSpan>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads all standard output and standard error of the process as lines of text, interleaving them as they become available.
public System.Collections.Generic.IEnumerable<System.Diagnostics.ProcessOutputLine> ReadAllLines(TimeSpan? timeout = default);
member this.ReadAllLines : Nullable<TimeSpan> -> seq<System.Diagnostics.ProcessOutputLine>
Public Function ReadAllLines (Optional timeout As Nullable(Of TimeSpan) = Nothing) As IEnumerable(Of ProcessOutputLine)
Parameters
The maximum amount of time to wait for the streams to be fully read. When null, waits indefinitely.
Returns
An enumerable of ProcessOutputLine instances representing the lines read from standard output and standard error.
Exceptions
timeout, truncated to a whole number of milliseconds, is less than -1 or greater than MaxValue.
Standard output or standard error has not been redirected.
-or-
A redirected stream has already been used for synchronous or asynchronous reading.
The operation did not complete within the specified timeout.
The process has been disposed.
Remarks
Lines from standard output and standard error are yielded as they become available. When data is available in both standard output and standard error, standard error is processed first.