Guest User

Untitled

a guest
Mar 9th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6. Option Explicit
  7.  
  8.  
  9.  
  10. Dim message, inputUser, inputPass, count, add, answer, dob, age
  11. Dim user1, user2, user3, pass1, pass2, pass3
  12. Dim lot1, lot2, lot3, lot4, lot5, lot6
  13.  
  14.  
  15. user1 = ("Cyril Aylmer")
  16. pass1 = ("Heidelberg")
  17.  
  18. user2 = ("Len Kerr")
  19. pass2 = ("Linotype")
  20.  
  21. user3 = ("Jacob Rossi")
  22. pass3 = ("Geelong05")
  23.  
  24.  
  25. inputUser = trim(InputBox ("Possible users:"&VbCrLf& " " &user1& VbCrLf & " " & user2 & VbCrLf & " " & user3 & VbCrLf & "Enter user name","Login - Username",""))
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. do while Lcase(inputUser) <> Lcase(user1) and Lcase(inputUser) <> Lcase(user2) and Lcase(inputUser) <> Lcase(user3)
  33.  
  34. msgbox inputUser &" is Not a valid username",vbOk + vbCritical,"Login Failure"
  35. inputUsername = trim(InputBox ("Possible users:"&VbCrLf&user1& VbCrLf & user2 & VbCrLf & user3 & VbCrLf & "Enter user name","Login - Username",""))
  36.  
  37. Loop
  38.  
  39. If Lcase(inputUser) = Lcase(user1) then
  40.  
  41. count = 0
  42. inputPass = trim(InputBox ("Please enter your password", "Login - Password",""))
  43.  
  44.  
  45.  
  46. do while count < 2 and Lcase(inputPass) <> Lcase(pass1)
  47.  
  48. inputPass = trim(InputBox ("Please enter your password", "Login - Password",""))
  49. count = count + 1
  50.  
  51. Loop
  52.  
  53.  
  54. If Lcase(inputPass) = Lcase(pass1) Then
  55.  
  56. count = 0
  57. add = InputBox ("Please enter your address","Login - Successful","")
  58.  
  59.  
  60. do while count < 3
  61.  
  62. message = message & count+1 & ". " & user1 & " lives at " & add &vbcrlf
  63. count = count + 1
  64.  
  65. Loop
  66.  
  67. msgbox message,vbOk + vbInformation,user1 & "'s address"
  68.  
  69. Else
  70.  
  71. msgbox "You supplied an incorrect password",vbOkonly + vbCritical,"Login Failure"
  72.  
  73. end If
  74.  
  75. end If
  76.  
  77.  
  78. if Lcase(inputUser) = Lcase(user2) then
  79.  
  80. count = 0
  81. inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
  82.  
  83.  
  84. do while count < 2 and Lcase(inputPass) <> Lcase(pass2)
  85.  
  86. inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
  87. count = count + 1
  88.  
  89. Loop
  90.  
  91.  
  92. If Lcase(inputPass) = Lcase(pass2) then
  93.  
  94. count = 0
  95.  
  96. lot1 = Cint ((42-1 + 1 ) * rnd +1)
  97. lot2 = Cint ((42-1 + 1 ) * rnd +1)
  98. lot3 = Cint ((42-1 + 1 ) * rnd +1)
  99. lot4 = Cint ((42-1 + 1 ) * rnd +1)
  100. lot5 = Cint ((42-1 + 1 ) * rnd +1)
  101. lot6 = Cint ((42-1 + 1 ) * rnd +1)
  102.  
  103. msgbox "Random numbers for Lotto"& vbcrlf & lot1 & " " & lot2 & " " & lot3 & " " & lot4 & " " & lot5 & " " & lot6 ,vbOk + vbExclamation,"Len's Lucky Lotto"
  104.  
  105. Else
  106.  
  107. msgbox "You supplied an incorrect password",vbOkOnly + vbCritical,"Login Failure"
  108.  
  109. end If
  110.  
  111. end If
  112.  
  113.  
  114. if Lcase(inputUser) = Lcase(user3) then
  115.  
  116. count = 0
  117. inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
  118.  
  119.  
  120. do while count < 2 and Lcase(inputPass) <> Lcase(pass3)
  121.  
  122. inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
  123. count = count + 1
  124.  
  125. Loop
  126.  
  127.  
  128. If Lcase(inputPass) = Lcase(pass3) then
  129.  
  130. dob = InputBox ("Please enter your Birth year","My Age",0)
  131. answer = msgBox ("Have you had a birthday this year?",vbYesNo + vbQuestion,"My Age")
  132.  
  133. if answer = vbYes Then
  134.  
  135. age = 2011 - DOB
  136. msgbox "You were born in "& DOB & vbcrlf & "and you are now aged "& age,vbOkOnly + vbCritical,"Your Age"
  137.  
  138. else
  139.  
  140. age = 2010 - DOB
  141. msgbox "You were born in "& DOB & vbcrlf & "and you are now aged "& age,vbOkOnly + vbCritical,"My Age"
  142.  
  143. end if
  144.  
  145. Else
  146.  
  147. msgbox "You supplied an incorrect password",vbOkOnly + vbCritical,"Login Failure"
  148.  
  149. end if
  150.  
  151. end if
Add Comment
Please, Sign In to add comment