Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim message, inputUser, inputPass, count, add, answer, dob, age
- Dim user1, user2, user3, pass1, pass2, pass3
- Dim lot1, lot2, lot3, lot4, lot5, lot6
- user1 = ("Cyril Aylmer")
- pass1 = ("Heidelberg")
- user2 = ("Len Kerr")
- pass2 = ("Linotype")
- user3 = ("Jacob Rossi")
- pass3 = ("Geelong05")
- inputUser = trim(InputBox ("Possible users:"&VbCrLf& " " &user1& VbCrLf & " " & user2 & VbCrLf & " " & user3 & VbCrLf & "Enter user name","Login - Username",""))
- do while Lcase(inputUser) <> Lcase(user1) and Lcase(inputUser) <> Lcase(user2) and Lcase(inputUser) <> Lcase(user3)
- msgbox inputUser &" is Not a valid username",vbOk + vbCritical,"Login Failure"
- inputUsername = trim(InputBox ("Possible users:"&VbCrLf&user1& VbCrLf & user2 & VbCrLf & user3 & VbCrLf & "Enter user name","Login - Username",""))
- Loop
- If Lcase(inputUser) = Lcase(user1) then
- count = 0
- inputPass = trim(InputBox ("Please enter your password", "Login - Password",""))
- do while count < 2 and Lcase(inputPass) <> Lcase(pass1)
- inputPass = trim(InputBox ("Please enter your password", "Login - Password",""))
- count = count + 1
- Loop
- If Lcase(inputPass) = Lcase(pass1) Then
- count = 0
- add = InputBox ("Please enter your address","Login - Successful","")
- do while count < 3
- message = message & count+1 & ". " & user1 & " lives at " & add &vbcrlf
- count = count + 1
- Loop
- msgbox message,vbOk + vbInformation,user1 & "'s address"
- Else
- msgbox "You supplied an incorrect password",vbOkonly + vbCritical,"Login Failure"
- end If
- end If
- if Lcase(inputUser) = Lcase(user2) then
- count = 0
- inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
- do while count < 2 and Lcase(inputPass) <> Lcase(pass2)
- inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
- count = count + 1
- Loop
- If Lcase(inputPass) = Lcase(pass2) then
- count = 0
- lot1 = Cint ((42-1 + 1 ) * rnd +1)
- lot2 = Cint ((42-1 + 1 ) * rnd +1)
- lot3 = Cint ((42-1 + 1 ) * rnd +1)
- lot4 = Cint ((42-1 + 1 ) * rnd +1)
- lot5 = Cint ((42-1 + 1 ) * rnd +1)
- lot6 = Cint ((42-1 + 1 ) * rnd +1)
- msgbox "Random numbers for Lotto"& vbcrlf & lot1 & " " & lot2 & " " & lot3 & " " & lot4 & " " & lot5 & " " & lot6 ,vbOk + vbExclamation,"Len's Lucky Lotto"
- Else
- msgbox "You supplied an incorrect password",vbOkOnly + vbCritical,"Login Failure"
- end If
- end If
- if Lcase(inputUser) = Lcase(user3) then
- count = 0
- inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
- do while count < 2 and Lcase(inputPass) <> Lcase(pass3)
- inputPass = trim(InputBox ("Please enter your password","Login - Password",""))
- count = count + 1
- Loop
- If Lcase(inputPass) = Lcase(pass3) then
- dob = InputBox ("Please enter your Birth year","My Age",0)
- answer = msgBox ("Have you had a birthday this year?",vbYesNo + vbQuestion,"My Age")
- if answer = vbYes Then
- age = 2011 - DOB
- msgbox "You were born in "& DOB & vbcrlf & "and you are now aged "& age,vbOkOnly + vbCritical,"Your Age"
- else
- age = 2010 - DOB
- msgbox "You were born in "& DOB & vbcrlf & "and you are now aged "& age,vbOkOnly + vbCritical,"My Age"
- end if
- Else
- msgbox "You supplied an incorrect password",vbOkOnly + vbCritical,"Login Failure"
- end if
- end if
Add Comment
Please, Sign In to add comment