Write All Bytes Async(String, Byte, CancellationToken) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
public static System.Threading.Tasks.Task WriteAllBytesAsync (string path, byte bytes, System.Threading.CancellationToken cancellationToken = default);
static member WriteAllBytesAsync : string * byte * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function WriteAllBytesAsync (path As String, bytes As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task
The file to write to.
The bytes to write to the file.
The token to monitor for cancellation requests. The default value is None.
A task that represents the asynchronous write operation.