I want to delete a folder with it’s all files in windows phone. In the wp7.1 SDK, I just found follow APIs:
public void DeleteDirectory(string dir);
public void DeleteFile(string file);
If a folder is not empty and I call the DeleteDirectory method, there is an exception.
So, is there any way to delete the files in the target folder?
Using
GetFileNamesget all the filenames in a directory. Then Iterate and delete all the files. thereafter when the folder is empty delete it too. I hope this helps.