• 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
{system.unauthorizedAccessException}
{"Access to the path \"\\\\10.8.8.155\\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?
Thanks,
                                    
0
young_nacs
Asked:
young_nacs
1 Solution
 
RomanPetrenkoCommented:
You need permissions to this folder.
BTW, You can use @ sign to avoid doubling of \ character in path.
instead of
"\\\\10.8.8.155\\anka\\eyeroute\\prod\\v50x\\studies\\tn\\600000\\400002\\20041009\\800031\\300140\"
you write
@"\\10.8.8.155\anka\eyeroute\prod\v50x\studies\tn\600000\400002\20041009\800031\300140\"

Pay attention that in error message last \ is not doubled - may be here is the problem?
0
 
rajaloysiousCommented:
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)

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

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