Nine:
If the target directory has any subdirectory(ies) in it then Directory.Delete() will throw an exception that "Directory is not empty".
Fix:
1. Traverse from the bottom to top of the target directory path.
2. In order to Traverse, we need to construct the absolute path of the target directory and its subdirectories.
3. Once we have the absolute path, we can enumerate the directories and perform Deletion one by one.
No comments:
Post a Comment