UNC Path Problem

Discussion in 'ASP .Net' started by G. Dean Blake, Jul 27, 2004.

  1. I have a UNC path that points to a shared directory on another Windows XP
    computer. The UNC is \\mylaptop\c\shareddir. This UNC works if I put it
    into my i.e. browser so I know it's a good link.



    But when I execute the following code....



    Dim rootdi As DirectoryInfo = New
    DirectoryInfo(Session("ScannedInvoicesDirectory"))

    If Not rootdi.Exists Then

    lblError.Text = "Scanned Directory" & Session("ScannedInvoicesDirectory")
    & "does not exist"

    Exit Sub

    End If



    .... it fails. rootdi.exists is false. This code works on my development
    machines just fine but it is failing on our production servers.



    Does anyone have a clue?

    Thanks,

    G
     
    G. Dean Blake, Jul 27, 2004
    #1
    1. Advertising

  2. G. Dean Blake

    Bobby Ryzhy Guest

    On Tue, 27 Jul 2004 10:04:38 -0700, "G. Dean Blake" <> wrote:

    >I have a UNC path that points to a shared directory on another Windows XP
    >computer. The UNC is \\mylaptop\c\shareddir. This UNC works if I put it
    >into my i.e. browser so I know it's a good link.
    >
    >
    >
    >But when I execute the following code....
    >
    >
    >
    >Dim rootdi As DirectoryInfo = New
    >DirectoryInfo(Session("ScannedInvoicesDirectory"))
    >
    >If Not rootdi.Exists Then
    >
    > lblError.Text = "Scanned Directory" & Session("ScannedInvoicesDirectory")
    >& "does not exist"
    >
    > Exit Sub
    >
    >End If
    >
    >
    >
    >... it fails. rootdi.exists is false. This code works on my development
    >machines just fine but it is failing on our production servers.
    >
    >
    >
    >Does anyone have a clue?
    >
    >Thanks,
    >
    >G
    >



    Your ASP_NET user does not have the rights to the other machine file system.


    Bobby Ryzhy
    bobby @ domain below
    http://weekendtech.net
     
    Bobby Ryzhy, Jul 27, 2004
    #2
    1. Advertising

  3. G. Dean Blake

    Hardy Wang Guest

    Try to impersonate at run time.

    --
    WWW: http://hardywang.1accesshost.com
    ICQ: 3359839
    yours Hardy
    "G. Dean Blake" <> wrote in message
    news:%23IjZKv$...
    > I have a UNC path that points to a shared directory on another Windows XP
    > computer. The UNC is \\mylaptop\c\shareddir. This UNC works if I put it
    > into my i.e. browser so I know it's a good link.
    >
    >
    >
    > But when I execute the following code....
    >
    >
    >
    > Dim rootdi As DirectoryInfo = New
    > DirectoryInfo(Session("ScannedInvoicesDirectory"))
    >
    > If Not rootdi.Exists Then
    >
    > lblError.Text = "Scanned Directory" &

    Session("ScannedInvoicesDirectory")
    > & "does not exist"
    >
    > Exit Sub
    >
    > End If
    >
    >
    >
    > ... it fails. rootdi.exists is false. This code works on my development
    > machines just fine but it is failing on our production servers.
    >
    >
    >
    > Does anyone have a clue?
    >
    > Thanks,
    >
    > G
    >
    >
     
    Hardy Wang, Jul 29, 2004
    #3
    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. Kevin Joseph
    Replies:
    5
    Views:
    4,347
    Joe Smith
    Aug 13, 2004
  2. =?Utf-8?B?RGVhbiBNY0NhcnRlbg==?=

    Retrieving UNC Path of Mapped Drives on Client Machine

    =?Utf-8?B?RGVhbiBNY0NhcnRlbg==?=, Apr 30, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    5,607
    =?Utf-8?B?RGVhbiBNY0NhcnRlbg==?=
    May 20, 2004
  3. Bill Tinker
    Replies:
    1
    Views:
    361
    Alexey Smirnov
    Jun 20, 2008
  4. Bill Tinker
    Replies:
    0
    Views:
    124
    Bill Tinker
    Jun 19, 2008
  5. Claudio
    Replies:
    0
    Views:
    151
    Claudio
    Jul 23, 2008
Loading...

Share This Page