VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Two Functions For Passwords

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

Rate 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


Download this snippet    Add to My Saved Code

Two Functions For Passwords Comments

No comments have been posted about Two Functions For Passwords. Why not be the first to post a comment about Two Functions For Passwords.

Post your comment

Subject:
Message:
0/1000 characters