Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleVerify the user's Windows password
DescriptionThis example shows how to verify the user's Windows password in Visual Basic 6. It uses the WNetVerifyPassword API function to check the password.
Keywordspassword, cryptography, Windows password
CategoriesSoftware 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.
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated