I am trying to delete a picture stored in my local folder in my UWP application. However, I am not very sure how to do it.
The picture file is located under "Pictures", which I think the path is:
C:\Users\UserName\Pictures
I have written a set of code which I believe is to retrieve the file... however, I am not sure how to continue from here.
StorageFolder picturesFolder = KnownFolders.PicturesLibrary;
string name = "deletetest.jpg";
StorageFile manifestFile = await picturesFolder.GetFileAsync(name);
Just add this lines.DeleteAsync will delete the file.
StorageFolder picturesFolder = KnownFolders.PicturesLibrary;
string name = "deletetest.jpg";
StorageFile manifestFile = await picturesFolder.GetFileAsync(name);
await manifestFile.DeleteAsync();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With