Process.ReadAllTextAsync(CancellationToken) 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.
Asynchronously reads all standard output and standard error of the process as text.
public System.Threading.Tasks.Task<(string StandardOutput, string StandardError)> ReadAllTextAsync(System.Threading.CancellationToken cancellationToken = default);
member this.ReadAllTextAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<ValueTuple<string, string>>
Public Function ReadAllTextAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of ValueTuple(Of String, String))
Parameters
- cancellationToken
- CancellationToken
A token to cancel the asynchronous operation.
Returns
A task that represents the asynchronous read operation. The value of the task contains a tuple with the standard output and standard error text.
Exceptions
Standard output or standard error has not been redirected.
-or-
A redirected stream has already been used for synchronous or asynchronous reading.
The cancellationToken was canceled.
The process has been disposed.