Closed Thread
Results 1 to 3 of 3

Thread: Access server file from Client

  1. #1
    ahpooh is offline Newbie
    Join Date
    Jan 2007
    Posts
    5
    Rep Power
    0

    Access server file from Client

    hi all,
    i having a problem to access server folder.
    i got one folder inside server, which i already shared.
    but when i access that folder fail.

    dim host as string = "\\serverId\folder\file.xml"
    doc.Load(host)
    .....

    error :System.IO.IOException = {"Logon failure: unknown user name or bad password.

    how i pass the user name and password?

    any one help please.........

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest
    You need to impersonate a user:

    Code:
    Dim impContext As WindowsImpersonationContext = Nothing
       Try
          impContext = NetworkSecurity.ImpersonateUser("mydomain", 
               "Username", "password", LogonType.LOGON32_LOGON_NETWORK, 
               LogonProvider.LOGON32_PROVIDER_DEFAULT)
       Catch ex As ApplicationException
               impContext.Undo()
               Response.Write(ex.Message)
       End Try

  4. #3
    ahpooh is offline Newbie
    Join Date
    Jan 2007
    Posts
    5
    Rep Power
    0
    hi jordon,
    can i have the more complete source?
    is it i need to define the networksecurity class myself? or how?

    thanks for reply

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-24-2010, 01:14 PM
  2. Client Server
    By houlahan in forum Java Help
    Replies: 1
    Last Post: 02-02-2010, 09:18 AM
  3. Client/Server
    By dani in forum C and C++
    Replies: 3
    Last Post: 11-11-2008, 07:43 AM
  4. Access server file from client
    By ahpooh in forum Visual Basic Programming
    Replies: 1
    Last Post: 09-06-2007, 11:36 AM
  5. Client / Server
    By eric in forum General Programming
    Replies: 2
    Last Post: 09-03-2007, 07:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts