|
|
|
Click here to copy the following block | Private Declare Function LogonUser Lib "Advapi32" Alias "LogonUserA" (ByVal _ lpszUserName As String, ByVal lpszDomain As String, _ ByVal lpszPassword As String, ByVal dwLogonType As Long, _ ByVal dwLogonProvider As Long, phToken As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As _ Long Const LOGON32_PROVIDER_DEFAULT = 0& Const LOGON32_LOGON_NETWORK = 3&
Private Function CheckWindowsUser(ByVal UserName As String, _ ByVal Password As String, Optional ByVal Domain As String) As Boolean Dim hToken As Long, ret As Long
If Len(Domain) = 0 Then Domain = vbNullString ret = LogonUser(UserName, Domain, Password, LOGON32_LOGON_NETWORK, _ LOGON32_PROVIDER_DEFAULT, hToken) If ret Then CheckWindowsUser = True CloseHandle hToken End If
End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|