Re: Directory.exists doesn't work on remote machines?

Discussion in 'ASP .Net' started by Shafter, Jan 7, 2005.

  1. Shafter

    Shafter Guest

    I tried the suggestion below and directory.exists still failed for me.

    I am using .NET 1.0

    Willy Denoyette wrote:
    > Try this:
    >
    > \\\\REMOTEMACHINE\\SharedDirectory\\*
    >
    > Willy.
    >
    >
    > "Craig Richardson" <> wrote in message

    news:uiltt2YiBHA.1940@tkmsftngp07...
    > > I tried that as well. Mapped a drive to the shared directory but

    still
    > > didn't work.
    > >
    > > "Darren Clark" <> wrote in message
    > > news:#VYF23UiBHA.1896@tkmsftngp05...
    > > > I have read before that they only work on named drives..
    > > >
    > > > eg if you have a network drive mapped this works...
    > > >
    > > > but the UNC way doesnt...
    > > >
    > > > I may be wrong but this is what i have read
    > > > "Craig Richardson" <> wrote in

    message
    > > > news:eTTbsdQiBHA.1540@tkmsftngp05...
    > > > > I have a shared drive on a remote machine from the webserver.

    When I
    > > > > execute the directory.exists for the path to the shared drive

    it always
    > > > > fails. Does this mean that Directory commands like create etc

    only work
    > > > > locally?
    > > > >
    > > > > The code was:
    > > > > if (Directory.Exists(\\\\REMOTEMACHINE\\SharedDirectory) {
    > > > > ....
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >
     
    Shafter, Jan 7, 2005
    #1
    1. Advertising

  2. Shafter

    bruce barker Guest

    unc paths will not work unless the asp.net account is running under a domain
    account with permission to the share. asp.net generally runs as a local
    account. and will not have permission. if asp.net is impersonating the
    client, then the one-hop rule will prevent access.

    -- bruce (sqlwork.com)

    "Shafter" <> wrote in message
    news:...
    | I tried the suggestion below and directory.exists still failed for me.
    |
    | I am using .NET 1.0
    |
    | Willy Denoyette wrote:
    | > Try this:
    | >
    | > \\\\REMOTEMACHINE\\SharedDirectory\\*
    | >
    | > Willy.
    | >
    | >
    | > "Craig Richardson" <> wrote in message
    | news:uiltt2YiBHA.1940@tkmsftngp07...
    | > > I tried that as well. Mapped a drive to the shared directory but
    | still
    | > > didn't work.
    | > >
    | > > "Darren Clark" <> wrote in message
    | > > news:#VYF23UiBHA.1896@tkmsftngp05...
    | > > > I have read before that they only work on named drives..
    | > > >
    | > > > eg if you have a network drive mapped this works...
    | > > >
    | > > > but the UNC way doesnt...
    | > > >
    | > > > I may be wrong but this is what i have read
    | > > > "Craig Richardson" <> wrote in
    | message
    | > > > news:eTTbsdQiBHA.1540@tkmsftngp05...
    | > > > > I have a shared drive on a remote machine from the webserver.
    | When I
    | > > > > execute the directory.exists for the path to the shared drive
    | it always
    | > > > > fails. Does this mean that Directory commands like create etc
    | only work
    | > > > > locally?
    | > > > >
    | > > > > The code was:
    | > > > > if (Directory.Exists(\\\\REMOTEMACHINE\\SharedDirectory) {
    | > > > > ....
    | > > > >
    | > > > >
    | > > > >
    | > > >
    | > > >
    | > >
    | > >
    |
     
    bruce barker, Jan 7, 2005
    #2
    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. Max
    Replies:
    4
    Views:
    10,935
    Kevin Spencer
    Aug 11, 2006
  2. chris
    Replies:
    0
    Views:
    652
    chris
    Sep 7, 2006
  3. =?ISO-8859-1?Q?Martin_J=F8rgensen?=

    how to create sub-directory if it doesn't exists?

    =?ISO-8859-1?Q?Martin_J=F8rgensen?=, Apr 12, 2006, in forum: C Programming
    Replies:
    9
    Views:
    343
    Vladimir S. Oka
    Apr 12, 2006
  4. Ulf Meinhardt
    Replies:
    8
    Views:
    6,159
  5. Tilman
    Replies:
    0
    Views:
    417
    Tilman
    Mar 19, 2008
Loading...

Share This Page