- private async Task<string> DeleteFolderHelper(string folderName)
- {
- try
- {
- string appDataPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
- StorageFolder appFolder = await StorageFolder.GetFolderFromPathAsync(appDataPath + "\\" + folderName);
- await appFolder.DeleteAsync();
- return "success";
- }
- catch (Exception ex)
- {
- return "false";
- }
- }
The following code snippet deletes the given folder from the Application local folder. This code returns 'success' if it deletes the folder successfully and returns 'fail' if not.
