user name, password validation

  • Thread starter Thread starter hkadhim
  • Start date Start date
H

hkadhim

hi all,
I am trying to validate a user name and password using server 2000 domain
validation. so users would use their normal ID and passwords to login.
does anyone know how to do it or have any examples?

thanks a lot
 
In C#:
include:

using System.Runtime.InteropServices;

namespace blah blah....
{
public class blah blah....
{
[DllImport("advapi32.dll")]
public static extern bool LogonUser(String lpszUsername, String
lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, ref
IntPtr phToken);

[WebMethod]
public bool Login(string sUserName, string sPassword, string
sDomain)
{
IntPtr tokenHandle = new IntPtr(0);
bool bLogonReturn= LogonUser(sUserName, sDomain, sPassword, 2,
0, ref tokenHandle);
return bLogonReturn;
}
}
}


Hope this helps
Regards
Gavin
 

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

Back
Top