VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Code to put in a password form, only gives the user 3 tries to enter the correct password then auto

by Shariff (6 Submissions)
Category: Encryption
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 3rd April 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Code to put in a password form, only gives the user 3 tries to enter the correct password then automatically unloads.

Rate Code to put in a password form, only gives the user 3 tries to enter the correct password then auto



On Error Resume Next
Dim counter As Integer
Dim pw As String
pw = Text1.Text
counter = counter + 1
         If counter > 2 Then
         MsgBox "Strike 3 Your Out", vbCritical
         End
            Else
            If pw <> "PASSWORD" Then
            MsgBox "Strike " & counter
            Text1.SelStart = 0
            Text1.SelLength = Len(Text1)
            End If
         End If
                If pw = "shariff" Then
                Form1.Visible = True
                Unload PassWordfrm
                End If
End Sub
Private Sub Command2_Click()
End
End Sub


Private Sub Text1_KeyPress(KeyAscii As Integer)
Command1.Default = True
End Sub

Download this snippet    Add to My Saved Code

Code to put in a password form, only gives the user 3 tries to enter the correct password then auto Comments

No comments have been posted about Code to put in a password form, only gives the user 3 tries to enter the correct password then auto. Why not be the first to post a comment about Code to put in a password form, only gives the user 3 tries to enter the correct password then auto.

Post your comment

Subject:
Message:
0/1000 characters