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

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
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();
See Also