語言

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範圍內完成。

該程序已被終止。

適用於