Click or drag to resize
GDStorageFileDeleteAsync Method (StorageDeleteOption)
Deletes the current file.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public IAsyncAction DeleteAsync(
	StorageDeleteOption option
)

Parameters

option
Type: Windows.StorageStorageDeleteOption
Value of this parameter is always ignored.

Return Value

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

Implements

IGDStorageItemDeleteAsync(StorageDeleteOption)
IGDStorageItemDeleteAsync(StorageDeleteOption)
Exceptions
ExceptionCondition
Exception File could not be deleted. To handle all the reasons why the file was not deleted, you must catch all of these exceptions:
ERROR_FILE_NOT_FOUND
Remarks
This method always deletes files permanently.
Examples
The following example shows how to delete file that has the specified absolute path in the SDK secure storage.
using GD;
...
// Get the app's secure folder.
GDStorageFolder secureFolder = GDWindows.Instance.SecureFolder;

// Create a sample file in the secure folder.
string newFileName = "test.txt";
GDStorageFile newFile = await tempFolder.CreateFileAsync(newFileName);

// Delete file
await newFile.DeleteAsync(StorageDeleteOption.Default);
See Also