語言

Process.ReadAllLines(Nullable<TimeSpan>) 方法

定義

將流程中所有標準輸出與標準誤讀為文字行,並在可用時交錯使用。

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)

參數

timeout
Nullable<TimeSpan>

等待串流完全讀取的最大時間。 當 null,則無限期等待。

傳回

一個可 ProcessOutputLine 枚舉的實例,代表從標準輸出和標準誤讀取的行。

例外狀況

timeout截斷為整數毫秒後,小於 -1 或大於 MaxValue。

標準輸出或標準誤差未被重新導向。

-或者-

重定向串流已被用於同步或非同步讀取。

操作未在指定 timeout範圍內完成。

該程序已被終止。

備註

標準輸出與標準誤的線條會在可用時產生。 當資料同時有標準輸出與標準誤時,標準誤會先被處理。

適用於