Directory.Delete(path, true); doesn't work (.net 1.1) and admin can't delete

Hello all.  I have a web application that creates a user temp directory, copies files into that directory, manipulates those files, sends files to the user, and then calls Directory.Delete(path, true); to delete the temp directory and all of its contents.  The problem is that this doesn't work and the directory is still there after the method call and code execution is complete.  I also can't delete the directory manually even when logged in as an Administrator.  It says 'Cannot delete <path>: Access is denied.'.  I was under the impression that specifying 'true' in the method call would recursively delete all files and sub-directories in the directory that is used in the method call.  Any ideas on why I can't delete this folder or how to debug?  I've put the method call in a try/catch block and it doesn't appear that an exception is being caught.

try   
{
      Directory.Delete(path, true
);
}
catch
(Exception ex)
{
      lblError.Text = ex.Message;
}

Also, when I try to open the directory using Windows Explorer, I receive an 'Access is denied' error even though I am an Administrator.

0
ike2010
8/17/2006 1:08:05 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
1433 Views

Similar Articles

[PageSpeed] 37

1. Right click the dirctory

2. Select the Security tab

3. Check out if your account exists and the acount has the permission

0
Dragon
8/18/2006 4:54:36 AM
Reply:

Web resources about - Directory.Delete(path, true); doesn't work (.net 1.1) and admin can't delete - asp.net.web-forms

Resources last updated: 11/26/2015 10:26:08 PM