This is not very secure… so we need to verify that the user sending the message is the one who logged into Win95 or WinNT.
I searched and searched on how to do this, with no luck. After posting this message on a new group, I was sent the answer and it’s surprising easy! It’s too bad that Microsoft has to make it so hard for use to find.
Win95
Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _
"WNetVerifyPasswordA" (ByVal lpszPassword As String, _
ByRef pfMatch As Long) As Long
Function VerifyPassWin95(sPassword As String) As Boolean
Dim lRetVal As Long
If (WNetVerifyPassword(sPassword, lRetVal)) <> 0 Then
MsgBox "VerifyPassWin95: Application Error"
Else
If lRetVal <> 0 Then
VerifyPassWin95 = True
Else
VerifyPassWin95 = False
End If
End If
End Function
Tip Submitted By: David McCarter
Code By: Jeff Hong YAN
Discover more from dotNetTips.com
Subscribe to get the latest posts sent to your email.
