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
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.
1. Right click the dirctory
2. Select the Security tab
3. Check out if your account exists and the acount has the permission