|
|
Title | Verify the user's Windows password |
Description | This example shows how to verify the user's Windows password in Visual Basic 6. It uses the WNetVerifyPassword API function to check the password. |
Keywords | password, cryptography, Windows password |
Categories | Software Engineering, API |
|
|
Thanks to David Roberts.
The VerifyWindowsLoginUserPassword function uses the WNetVerifyPassword API function to verify that the user entered the correct password for the user logged in.
|
|
Public Function VerifyWindowsLoginUserPassword(ByVal _
Password As String) As Boolean
Dim rtn As Long, Match As Long
rtn = WNetVerifyPassword(Password, Match)
If rtn Then
VerifyWindowsLoginUserPassword = False
Else
VerifyWindowsLoginUserPassword = (Match <> 0)
End If
End Function
|
|
Note that this program doesn't seem to run in Windows NT. I don't have NT running right now so I cannot try it.
|
|
|
|
|
|