Posted on 2006-04-10
Last Modified: 2008-02-01
I am getting the below error when i am trying read a file on the desktop. I am able to read the file on any other location. Can you tell me why i am getting this error.

System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\XXXXX\Desktop\kk\XXXXX86.JPG' is denied.

Here is the statement i am using to read the file.

System.IO.FileStream stream = new System.IO.FileStream(file,
Question by:k_kosaraju
    LVL 10

    Expert Comment

    Do you have read-only attribute unchecked?
    Are you/ included in Security tab and what permissions you have set?

    Author Comment

    yes read only is unchecked.

    where i need to set the security permissions.

    I launched my application online. When i try to read the file which is not on desktop i am getting this error.

    System.IO.IOException: The device is not ready.

    if i try to read the file on desktop i am getting this error

    LVL 10

    Accepted Solution

    System.IO.IOException: The device is not probably because you are trying to access C drive on the server
    System.IO.DirectoryNotFoundException ...error is self explanatory

    security permissions:
    file properties->security tab
    LVL 10

    Expert Comment

    solution provided

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    758 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

    7 Experts available now in Live!

    Get 1:1 Help Now