Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attribute VB_Name = "Module1"
- Sub Test()
- Dim username(5) As String
- Dim password(5) As String
- Dim eUser As String
- Dim ePass As String
- Dim c As Boolean
- Dim f As Boolean
- Dim g As Integer
- Dim tries As Integer
- tries = 3
- g = 0
- 'Account List
- username(0) = "bob"
- password(0) = "bob1"
- username(1) = "jake"
- password(1) = "cats4"
- username(2) = "john"
- password(2) = "superman1"
- username(3) = "aleks"
- password(3) = "cooldog6"
- username(4) = "shania"
- password(4) = "rjyy6"
- 'Check for Correct
- For i = 0 To 2
- eUser = InputBox("Enter Username:")
- ePass = InputBox("Enter Password:")
- f = False
- Do While c = False And f = False
- If eUser = username(g) And ePass = password(g) Then
- MsgBox ("Welcome, " & username(g) & "." & vbNewLine & "Logging in...")
- c = True
- i = 4
- Else
- g = g + 1
- If g >= 6 Then
- tries = tries - 1
- MsgBox ("Incorrect! You now have:" & vbNewLine & tries & " more attempts.")
- g = 0
- f = True
- End If
- End If
- Loop
- Next i
- 'After three failed attempts
- If f = True Then
- MsgBox ("Too Many Failed attempts! Try again later.")
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement