|
|
|
Click here to copy the following block | <System.Runtime.InteropServices.DllImport("advapi32")> Shared Function _ LogonUser(ByVal userName As String, ByVal domain As String, _ ByVal password As String, ByVal dwLogonType As Integer, _ ByVal dwLogonProvider As Integer, ByRef phToken As Integer) As Integer End Function
<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _ CloseHandle(ByVal hObject As Integer) As Integer End Function
Function CheckWindowsUser(ByVal userName As String, ByVal password As String, _ Optional ByVal domain As String = "") As Boolean Const LOGON32_PROVIDER_DEFAULT = 0& Const LOGON32_LOGON_NETWORK = 3&
Dim hToken, ret As Integer
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 ) |
|
|