Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Access to the path 'C:\\Program Files\\AAA' is denied."

Access to the path 'C:\\Program Files\\AAA' is denied."

Scheduled Pinned Locked Moved C#
helpcsharpxml
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ranandbe
    wrote on last edited by
    #1

    hi folks, I am new to .net , Now i have work with Windows application and i want to read the file from specific path. I have using filestream object for file access but it shows following error. Access to the path 'C:\\Program Files\\AAA' is denied." my code is, FileStream FS = new FileStream(@"C:/Program Files/Psis/Conf.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); is anybody face this problem before plz tell me the solution.

    E 1 Reply Last reply
    0
    • R ranandbe

      hi folks, I am new to .net , Now i have work with Windows application and i want to read the file from specific path. I have using filestream object for file access but it shows following error. Access to the path 'C:\\Program Files\\AAA' is denied." my code is, FileStream FS = new FileStream(@"C:/Program Files/Psis/Conf.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); is anybody face this problem before plz tell me the solution.

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      You don't have permission to either read or write or both to that directory.  Maybe you can't create a file in that directory, or that directory doesn't exist. The most likely cause (if you're running as an Admin / Power User) is that the Directory "C:\Program Files\Psis" doesn't exists. Ps. Not sure if it likes the forward slashes in the path, if the directory exists and you have permission to write to it then this maybe the cause, note that the @ symbol disables character escaping in the string so \ means \ rather than the prefix for an escaped character.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups