IStorageFolder.CreateFileAsync Method

Definition

Overloads

CreateFileAsync(String)

Creates a new file in the current folder.

CreateFileAsync(String, CreationCollisionOption)

Creates a new file in the current folder, and specifies what to do if a file with the same name already exists in the current folder.

CreateFileAsync(String)

Creates a new file in the current folder.

C#
[Windows.Foundation.Metadata.Overload("CreateFileAsyncOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName);

Parameters

desiredName
String

The desired name of the file to create.

Returns

When this method completes, it returns the new file as a StorageFile.

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

CreateFileAsync(String, CreationCollisionOption)

Creates a new file in the current folder, and specifies what to do if a file with the same name already exists in the current folder.

C#
[Windows.Foundation.Metadata.Overload("CreateFileAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName, CreationCollisionOption options);

Parameters

desiredName
String

The desired name of the file to create.

If there is an existing file in the current folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.

options
CreationCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing file in the current folder.

Returns

When this method completes, it returns the new file as a StorageFile.

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100