StorageFileHelper.WriteTextToFileAsync Method

Definition

Saves a string value to a Windows.Storage.StorageFile in the given Windows.Storage.StorageFolder.

public static System.Threading.Tasks.Task<Windows.Storage.StorageFile> WriteTextToFileAsync (this Windows.Storage.StorageFolder fileLocation, string text, string fileName, Windows.Storage.CreationCollisionOption options = Windows.Storage.CreationCollisionOption.ReplaceExisting);
static member WriteTextToFileAsync : Windows.Storage.StorageFolder * string * string * Windows.Storage.CreationCollisionOption -> System.Threading.Tasks.Task<Windows.Storage.StorageFile>
<Extension()>
Public Function WriteTextToFileAsync (fileLocation As StorageFolder, text As String, fileName As String, Optional options As CreationCollisionOption = Windows.Storage.CreationCollisionOption.ReplaceExisting) As Task(Of StorageFile)

Parameters

fileLocation
Windows.Storage.StorageFolder

The Windows.Storage.StorageFolder to save the file in.

text
String

The String value 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 text.

Exceptions

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

Applies to