Regarding {system.unauthorizedAccessException} on

Posted on 2005-04-06
Last Modified: 2008-02-07
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?
Question by:young_nacs
    LVL 8

    Accepted 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?
    LVL 8

    Expert Comment

    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)


    Author Comment

    No answer found yet.
    But thanks for the comment anyway.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now