by PulseWave (25 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Wed 24th February 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Two Functions For Passwords
'DUH!'
Dim nRetries As Integer
Dim sPassword As String
nRetries = 3
Do
sPassword = InputBox$("Enter the password")
nRetries = nRetries - 1
If nRetries = 0 Then
End
End If
Loop Until sPassword = password$
End Sub
Sub Password2(Password2$)
'DUH!'
Dim nRetries As Integer
Dim sPassword As String
nRetries = 3
Do
sPassword = InputBox$("Enter the password")
nRetries = nRetries - 1
Loop While sPassword <> Password2$ And nRetries > 0
If sPassword <> Password2$ Then
MsgBox "You got the password wrong - Access denied"
End
Else
MsgBox "Welcome to the system - password accepted"
End If
End Sub