Access to the path 'C:\\Program Files\\AAA' is denied."
-
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.
-
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.
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.