Regarding {system.unauthorizedAccessException} on

I am trying to access files in the backup server from primary server by
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?
Who is Participating?
RomanPetrenkoConnect With a Mentor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.