Reputation: 2085
I have a user setting, which asks the user if he wants to reset the app.
When the user hits Reset, I need to clear all the data in the local folder? My local folders have many sub folders. I have been searching for a remove function which removes the contents of local folder without any hassle? DeleteAsync
?
Thanks
Upvotes: 0
Views: 2945
Reputation: 2085
I have used DeleteAsync
to remove the folder and its contents.
private async Task<bool> DeleteFolder()
{
var folderlist = await m_localFolder.GetFoldersAsync();
foreach (StorageFolder folder in folderlist)
{
await folder.DeleteAsync(StorageDeleteOption.PermanentDelete);
}
return true;
}
Upvotes: 1