Hi, you can try something like:
using System.Runtime.InteropServ
[DllImport("KERNEL32.DLL",
public static extern bool CloseHandle( int hObject );
[DllImport("ADVAPI32.DLL",
public static extern bool LogonUser( string Username, string Domain, string Password, int dwLogonType, int dwLogonProvider, out int hToken );
and then in code, something like:
int hToken = 0;
try
{
if ( LogonUser( txtUsername.Text, txtDomain.Text, txtDomain.Text, 3, 0, out hToken ) )
MessageBox.Show( "oki" );
else
MessageBox.Show( "Noki" );
}
finally
{
CloseHandle( hToken );
}
hth,
Vasco
Main Topics
Browse All Topics





by: ghornetPosted on 2003-12-31 at 10:39:10ID: 10022820
Current user name can be found using Dim uname as string = User.Identity.Name.Substri ng(InStr(U ser.Identi ty.Name, "\")) if they are in your domain. As far as checking password I don't know, have to play with LDAP.