In my application, I'm trying to delete file from code behind but it throws the error called "accessed denied". Anyone can tell me that how to get whether the file is having delete permission or not.
Thanks in advance
In my application, I'm trying to delete file from code behind but it throws the error called "accessed denied". Anyone can tell me that how to get whether the file is having delete permission or not.
Thanks in advance
You can just handle the exception
If you try to find out before calling
Directory.Delete
there's a small chance that there's a race condition and something locks the directory which would cause your program to throw an exception. If this exception isn't handled the program will be in an unstable state.