Results 1 to 1 of 1

Thread: [RESOLVED] access denied

Hybrid View

  1. #1
    Hyperactive Member half flung pie's Avatar
    Join Date
    Jun 05
    Location
    South Carolina, USA
    Posts
    310

    Resolved [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
  •