I have written a application with C#.But,I continually get an error message of “access denied” for “App Data” under my user profile (password protected user account).BTW,I’m using Win7.
Here is my code:
string path = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "//Programım//");
I would use
System.IO.Path.Combine(...)instead ofstring.Conact(...)in this situation. Like this…The result of
pathin your original code might not be what you are actually expecting.Once you are sure your
pathvalue is correct then callSystem.IO.Directory.Delete(...)like…If that still is not working, then there may be some other security permission problems with files in that directory, or with the directory itself. See the MSDN page for all of the exceptions that can be thrown from the
Deletemethod and the reasons why.