Language

Process.ReadAllBytesAsync(CancellationToken) Method

Definition

Asynchronously reads all standard output and standard error of the process as byte arrays.

public System.Threading.Tasks.Task<(byte[] StandardOutput, byte[] StandardError)> ReadAllBytesAsync(System.Threading.CancellationToken cancellationToken = default);
member this.ReadAllBytesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<ValueTuple<byte[], byte[]>>
Public Function ReadAllBytesAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of ValueTuple(Of Byte(), Byte()))

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 bytes.

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.

Applies to