- The created folder is not deleting, how to delete the created folder through code?
- I am using asp.net with c# in dotnetnuke.
- I upload the thumbnail images, LargeImages, and MasterImages in separate folder.
- The thumbnails images (thumbs) and large image (slides) will display in swf.
- The folders are created. Images also set the created folder for /slides/ and /thumbs/.
- I can be deleted “/slides/ and /thumbs/” created folders .but the ImageFolders is not delete
My question: How to delete the ImageFolders folder?
Explanations:"\DesktopModules\EgtFlash\ImageFolders\slides”, just the created folder should set this path.
1. \DesktopModules\EgtFlash\ : is manual created (source folders).
2. \ImageFolders\ not a manual folder. (I didn’t add new folder also).
Error Messages is:
Cannot delete MasterImages: It is being used by another person or program
Close any programs that’s might be using the file and try again.
But, I closed my solution. Just I right click and select delete option. Again that same alt error message.
This is Code for create a new Folder:
string sDirPath = Server.MapPath(@"~\DesktopModules\EgtFlash\ImageFolders\slides\");
DirectoryInfo ObjSearchDir = new DirectoryInfo(sDirPath);
if (!ObjSearchDir.Exists)
{
ObjSearchDir.Create();
}
string sDirPath1 = Server.MapPath(@"~\DesktopModules\EgtFlash\ImageFolders\thumbs\");
DirectoryInfo ObjSearchDir1 = new DirectoryInfo(sDirPath1);
if (!ObjSearchDir1.Exists)
{
ObjSearchDir1.Create();
}
Any Idea?
Please replay with explanations and code also.
Regards
Beginner Developer