Failed to Access to Networked Resources

Discussion in 'ASP .Net Security' started by Speech Lover, Feb 22, 2007.

  1. Speech Lover

    Speech Lover Guest

    I am using ASP.NET 1.1.

    I am trying to manipulate remote shared folders and files through UNC
    format.
    For example: //server/dir1/abc.txt


    When I ran my c# code, I got an error: Unknown user name or bad password

    When I searched the Internet and it appears I can use Impersonate to change
    my identity before accessing to the networked resources. However, after
    added the reference code into the page it compiles fine but the page doesn't
    load in run time.

    Any idea?
    Is there an easy way to overcome the network security credential?

    Here's the code I added:

    public static bool NetworkImpersonate(string user, string machine, string
    password)
    {
    int token;

    if(!LogonUser(user, machine, password, 3, 0, out token)
    return false;

    return ImpersonateLoggedOnUser(token);
    }

    Speech Lover
     
    Speech Lover, Feb 22, 2007
    #1
    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. martin
    Replies:
    0
    Views:
    292
    martin
    Aug 18, 2003
  2. VisionSet

    networked application

    VisionSet, Oct 13, 2003, in forum: Java
    Replies:
    0
    Views:
    343
    VisionSet
    Oct 13, 2003
  3. Aaron Fude
    Replies:
    1
    Views:
    288
    David Hilsee
    Sep 28, 2004
  4. TC
    Replies:
    2
    Views:
    389
  5. Replies:
    0
    Views:
    391
Loading...

Share This Page