deleting a folder
-
I have an aspx website.I am trying to delete one user. While deleting I need to delete all files in one directory named "username" and after that the directory itself. The program deletes the files , but while deleting the directory it throws an exception saying "The directory is not empty". I am using the following code if (System.IO.Directory.Exists(Server .MapPath ("Albums/username" )) { System.IO.Directory.Delete(Server .MapPath ("Albums/username")); } If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB. Note: I am using this folder to store some images.
-
I have an aspx website.I am trying to delete one user. While deleting I need to delete all files in one directory named "username" and after that the directory itself. The program deletes the files , but while deleting the directory it throws an exception saying "The directory is not empty". I am using the following code if (System.IO.Directory.Exists(Server .MapPath ("Albums/username" )) { System.IO.Directory.Delete(Server .MapPath ("Albums/username")); } If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB. Note: I am using this folder to store some images.
-
I have an aspx website.I am trying to delete one user. While deleting I need to delete all files in one directory named "username" and after that the directory itself. The program deletes the files , but while deleting the directory it throws an exception saying "The directory is not empty". I am using the following code if (System.IO.Directory.Exists(Server .MapPath ("Albums/username" )) { System.IO.Directory.Delete(Server .MapPath ("Albums/username")); } If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB. Note: I am using this folder to store some images.
Soumini Ramakrishnan wrote:
If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB.
Are hidden file's and system file's displays on?
"Sometimes the greatest journey is the distance between two people" - Nice quote from a Nice Indian Movie