• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 534
  • Last Modified:

Regarding {system.unauthorizedAccessException} on Asp.net

I am trying to access files in the backup server from primary server by asp.net
And then I got next exception
{"Access to the path \"\\\\\\anka\\eyeroute\\prod\\v50x\\studies\\tn\\600000\\400002\\20041009\\800031\\300140\" is denied." }

My code is very simple as bellow:
DirectoryInfo di = new DirectoryInfo(uri);
FileInfo[] fi = di.GetFiles("*.jpg");

How to resolve this problem?
1 Solution
You need permissions to this folder.
BTW, You can use @ sign to avoid doubling of \ character in path.
instead of
you write

Pay attention that in error message last \ is not doubled - may be here is the problem?
This may be of help..
I guess you may need to give access permissions to the particular folder for the aspnet account or whatever(which is used by asp)

young_nacsAuthor Commented:
No answer found yet.
But thanks for the comment anyway.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now