StorageFile.DeleteAsync Method

Definition

Overloads

DeleteAsync()

Deletes the current file.

DeleteAsync(StorageDeleteOption)

Deletes the current file, optionally deleting the item permanently.

DeleteAsync()

Deletes the current file.

C#
[Windows.Foundation.Metadata.Overload("DeleteAsyncOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction DeleteAsync();

Returns

No object or value is returned by this method when it completes.

Implements

Attributes

Remarks

This method uses StorageDeleteOption.default to determine whether the item is deleted permanently.

FileNotFoundException is thrown if the file does not exist..

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

DeleteAsync(StorageDeleteOption)

Deletes the current file, optionally deleting the item permanently.

C#
[Windows.Foundation.Metadata.Overload("DeleteAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction DeleteAsync(StorageDeleteOption option);

Parameters

option
StorageDeleteOption

A value that indicates whether to delete the item permanently.

Returns

No object or value is returned by this method when it completes.

Implements

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