Taal

Process.ReadAllLinesAsync(CancellationToken) Methode

Definitie

Asynchroon leest alle standaarduitvoer en standaardfout van het proces als tekstregels en interleaseert ze zodra ze beschikbaar komen.

public System.Collections.Generic.IAsyncEnumerable<System.Diagnostics.ProcessOutputLine> ReadAllLinesAsync(System.Threading.CancellationToken cancellationToken = default);
member this.ReadAllLinesAsync : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<System.Diagnostics.ProcessOutputLine>
Public Function ReadAllLinesAsync (Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ProcessOutputLine)

Parameters

cancellationToken
CancellationToken

Een token om de asynchrone bewerking te annuleren.

Retouren

Een asynchroon opsomming van ProcessOutputLine exemplaren die de regels vertegenwoordigen die worden gelezen uit de standaarduitvoer en standaardfout.

Uitzonderingen

Standaarduitvoer of standaardfout is niet omgeleid.

– of –

Er is al een omgeleide stream gebruikt voor synchrone of asynchrone leesing.

De cancellationToken is geannuleerd.

Het proces is verwijderd.

Opmerkingen

Regels van standaarduitvoer en standaardfout worden gegenereerd zodra ze beschikbaar komen. Wanneer de consument stopt met opsommen (bijvoorbeeld door uit await foreachte breken), worden alle wachtende leesbewerkingen geannuleerd.

Van toepassing op