File.AppendAllBytesAsync Metodo

Definizione

Overload

AppendAllBytesAsync(String, Byte[], CancellationToken)

Aggiunge in modo asincrono la matrice di byte specificata alla fine del file nel percorso specificato.

Se il file non esiste, questo metodo crea un nuovo file. Se l'operazione viene annullata, l'attività restituirà uno stato annullato.

AppendAllBytesAsync(String, ReadOnlyMemory<Byte>, CancellationToken)

Aggiunge in modo asincrono la matrice di byte specificata alla fine del file nel percorso specificato.

Se il file non esiste, questo metodo crea un nuovo file. Se l'operazione viene annullata, l'attività restituirà uno stato annullato.

AppendAllBytesAsync(String, Byte[], CancellationToken)

Origine:
File.cs

Aggiunge in modo asincrono la matrice di byte specificata alla fine del file nel percorso specificato.

Se il file non esiste, questo metodo crea un nuovo file. Se l'operazione viene annullata, l'attività restituirà uno stato annullato.

public static System.Threading.Tasks.Task AppendAllBytesAsync (string path, byte[] bytes, System.Threading.CancellationToken cancellationToken = default);
static member AppendAllBytesAsync : string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function AppendAllBytesAsync (path As String, bytes As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task

Parametri

path
String

File a cui accodare.

bytes
Byte[]

Byte da aggiungere al file.

cancellationToken
CancellationToken

Token da monitorare per le richieste di annullamento. Il valore predefinito è None.

Restituisce

Eccezioni

path o bytes è null.

path è vuoto.

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Si applica a

AppendAllBytesAsync(String, ReadOnlyMemory<Byte>, CancellationToken)

Aggiunge in modo asincrono la matrice di byte specificata alla fine del file nel percorso specificato.

Se il file non esiste, questo metodo crea un nuovo file. Se l'operazione viene annullata, l'attività restituirà uno stato annullato.

public static System.Threading.Tasks.Task AppendAllBytesAsync (string path, ReadOnlyMemory<byte> bytes, System.Threading.CancellationToken cancellationToken = default);
static member AppendAllBytesAsync : string * ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function AppendAllBytesAsync (path As String, bytes As ReadOnlyMemory(Of Byte), Optional cancellationToken As CancellationToken = Nothing) As Task

Parametri

path
String

File a cui accodare.

bytes
ReadOnlyMemory<Byte>

Byte da aggiungere al file.

cancellationToken
CancellationToken

Token da monitorare per le richieste di annullamento. Il valore predefinito è None.

Restituisce

Eccezioni

path è null.

path è vuoto.

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Si applica a