语言

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范围内完成。

进程已释放。

注解

标准输出和标准错误的行在可用时生成。 当数据同时在标准输出和标准错误中可用时,首先处理标准错误。

适用于