GetDirectories UNC path - Acces Denied

Discussion in 'ASP .Net' started by frederik, Feb 1, 2005.

  1. frederik

    frederik Guest

    Hi

    The website have to show subdirectories on a network drive.

    I use the following code:

    string[] directories;
    directories=Directory.GetDirectories(_Path);
    ....

    The _Path contains an url like \\server\directory\subdirectory\
    Impersonate is set to true

    When i try the code from the localhost, i receive the subdirectories.

    When i try the _Path directly in my browser, i see the subdirectories.

    I copied the dll to the production server.
    When i use this dos command line to check if i have rights to read the
    _Path, everything works fine. (runas :user:username cmd)
    from this cmd screen i have acces to the _Path

    When i try the website, i receive always access denied, even if
    impersonate is set to true.
    Can someone explain me more about this problem ?

    frederik
    frederik, Feb 1, 2005
    #1
    1. Advertising

  2. I think the account that you are running IIS and asp.net on production server
    don't have access permission to the network path.

    "frederik" wrote:

    > Hi
    >
    > The website have to show subdirectories on a network drive.
    >
    > I use the following code:
    >
    > string[] directories;
    > directories=Directory.GetDirectories(_Path);
    > ....
    >
    > The _Path contains an url like \\server\directory\subdirectory\
    > Impersonate is set to true
    >
    > When i try the code from the localhost, i receive the subdirectories.
    >
    > When i try the _Path directly in my browser, i see the subdirectories.
    >
    > I copied the dll to the production server.
    > When i use this dos command line to check if i have rights to read the
    > _Path, everything works fine. (runas :user:username cmd)
    > from this cmd screen i have acces to the _Path
    >
    > When i try the website, i receive always access denied, even if
    > impersonate is set to true.
    > Can someone explain me more about this problem ?
    >
    > frederik
    >
    >
    =?Utf-8?B?UGVuZyBKaWU=?=, Feb 1, 2005
    #2
    1. Advertising

  3. Make sure that you are impersonating with an account that is set up on the
    remote server rather than trying to pass authentication around from one
    domain to another.

    "frederik" <> wrote in message
    news:...
    > Hi
    >
    > The website have to show subdirectories on a network drive.
    >
    > I use the following code:
    >
    > string[] directories;
    > directories=Directory.GetDirectories(_Path);
    > ...
    >
    > The _Path contains an url like \\server\directory\subdirectory\
    > Impersonate is set to true
    >
    > When i try the code from the localhost, i receive the subdirectories.
    >
    > When i try the _Path directly in my browser, i see the subdirectories.
    >
    > I copied the dll to the production server.
    > When i use this dos command line to check if i have rights to read the
    > _Path, everything works fine. (runas :user:username cmd)
    > from this cmd screen i have acces to the _Path
    >
    > When i try the website, i receive always access denied, even if
    > impersonate is set to true.
    > Can someone explain me more about this problem ?
    >
    > frederik
    >
    Ken Cox [Microsoft MVP], Feb 1, 2005
    #3
  4. frederik

    frederik Guest

    We cannot change the structure.

    I think that the account i'm impersonating with is correct setup
    because when i copy the project on my own pc, it's working fine.

    Even if i try to contact de folder from the server to the remote
    server, i have acces with my account. Only if it's running under a
    website i receive accessdenied.

    But why with IIS on the server and NOt with IIS on my local pc

    frederik
    frederik, Feb 2, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mamcx
    Replies:
    0
    Views:
    477
    Mamcx
    Jun 26, 2003
  2. =?Utf-8?B?TWlrZSBE?=

    Directory.GetDirectories display order

    =?Utf-8?B?TWlrZSBE?=, Mar 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,625
    =?Utf-8?B?TWlrZSBE?=
    Mar 30, 2005
  3. kamig
    Replies:
    0
    Views:
    421
    kamig
    Feb 25, 2006
  4. Nathan Sokalski
    Replies:
    2
    Views:
    1,120
  5. the max

    WebService 'Acces to path is denied'

    the max, May 9, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    159
    Chad Z. Hower aka Kudzu
    May 10, 2005
Loading...

Share This Page