Failed to Access to Networked Resources

S

Speech Lover

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top