Advertisement
Spinless

Untitled

Aug 8th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. Attribute VB_Name = "Module1"
  2. Sub Test()
  3. Dim username(5) As String
  4. Dim password(5) As String
  5. Dim eUser As String
  6. Dim ePass As String
  7. Dim c As Boolean
  8. Dim f As Boolean
  9. Dim g As Integer
  10. Dim tries As Integer
  11.  
  12. tries = 3
  13. g = 0
  14.  
  15. 'Account List
  16. username(0) = "bob"
  17. password(0) = "bob1"
  18. username(1) = "jake"
  19. password(1) = "cats4"
  20. username(2) = "john"
  21. password(2) = "superman1"
  22. username(3) = "aleks"
  23. password(3) = "cooldog6"
  24. username(4) = "shania"
  25. password(4) = "rjyy6"
  26.  
  27. 'Check for Correct
  28. For i = 0 To 2
  29. eUser = InputBox("Enter Username:")
  30. ePass = InputBox("Enter Password:")
  31. f = False
  32. Do While c = False And f = False
  33. If eUser = username(g) And ePass = password(g) Then
  34. MsgBox ("Welcome, " & username(g) & "." & vbNewLine & "Logging in...")
  35. c = True
  36. i = 4
  37. Else
  38. g = g + 1
  39. If g >= 6 Then
  40. tries = tries - 1
  41. MsgBox ("Incorrect! You now have:" & vbNewLine & tries & " more attempts.")
  42. g = 0
  43. f = True
  44. End If
  45. End If
  46. Loop
  47. Next i
  48. 'After three failed attempts
  49. If f = True Then
  50. MsgBox ("Too Many Failed attempts! Try again later.")
  51. End If
  52. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement