语言

Process.ReadAllBytes(Nullable<TimeSpan>) 方法

定义

读取进程的所有标准输出和标准错误作为字节数组。

public(byte[] StandardOutput, byte[] StandardError) ReadAllBytes(TimeSpan? timeout = default);
member this.ReadAllBytes : Nullable<TimeSpan> -> ValueTuple<byte[], byte[]>
Public Function ReadAllBytes (Optional timeout As Nullable(Of TimeSpan) = Nothing) As ValueTuple(Of Byte(), Byte())

参数

timeout
Nullable<TimeSpan>

等待流完全读取的最大时间。 当 null,无限期等待。

返回

包含标准输出和标准错误字节的元组。

例外

timeout截断为整数毫秒,小于 -1 或大于 MaxValue。

标准输出或标准错误尚未重定向。

- 或者 -

重定向流已用于同步或异步读取。

操作未在指定的 timeout范围内完成。

进程已释放。

适用于