|
-
Aug 17th, 2012, 09:18 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] access denied
I've written a program that pulls a directory from a registry key, then tries to delete all files in that directory.
I keep getting this message:
Access to the path 'C:\Users\Me\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\CYXW7LL1\20120727_084321.jpg' is denied.
My application is running as administrator <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Edit: fixed it.
FileInfo fi = new FileInfo(file);
if (!(fi.Attributes == FileAttributes.Normal)){
fi.Attributes = FileAttributes.Normal;
}
File.Delete(file);
Last edited by half flung pie; Aug 17th, 2012 at 12:57 PM.
 Base 2
Fcnncu"Nqxgu"Lguug##
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|