StorageFileHelper.WriteBytesToKnownFolderFileAsync Method

Definition

Saves an array of bytes to a Windows.Storage.StorageFile to well known folder/>.

public static System.Threading.Tasks.Task<Windows.Storage.StorageFile> WriteBytesToKnownFolderFileAsync (Windows.Storage.KnownFolderId knownFolderId, byte[] bytes, string fileName, Windows.Storage.CreationCollisionOption options = Windows.Storage.CreationCollisionOption.ReplaceExisting);
static member WriteBytesToKnownFolderFileAsync : Windows.Storage.KnownFolderId * byte[] * string * Windows.Storage.CreationCollisionOption -> System.Threading.Tasks.Task<Windows.Storage.StorageFile>
Public Function WriteBytesToKnownFolderFileAsync (knownFolderId As KnownFolderId, bytes As Byte(), fileName As String, Optional options As CreationCollisionOption = Windows.Storage.CreationCollisionOption.ReplaceExisting) As Task(Of StorageFile)

Parameters

knownFolderId
Windows.Storage.KnownFolderId

The well known folder ID to use.

bytes
Byte[]

The Byte array to save to the file.

fileName
String

The String name for the file.

options
Windows.Storage.CreationCollisionOption

The creation collision options. Default is ReplaceExisting.

Returns

Task<Windows.Storage.StorageFile>

The saved Windows.Storage.StorageFile containing the bytes.

Exceptions

Exception thrown if the file location or file name are null or empty.

Applies to