Advertisement
Guest User

Untitled

a guest
Oct 15th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1.  
  2. Public Class Form1
  3.  
  4. Private Sub btnUp_Click(sender As Object, e As EventArgs) Handles btnUp.Click
  5. Dim username As String
  6. Dim fname As String
  7. Dim password As String
  8. Dim age As Integer
  9. Dim yrgroup As Integer
  10. Dim filename As String
  11.  
  12. fname = InputBox("Please enter your first name")
  13. age = InputBox("Please enter your age")
  14. yrgroup = InputBox("Please ebter your year group")
  15.  
  16. username = Mid$(fname, 1, 3) + Mid$(age, 1, 3)
  17.  
  18.  
  19. password = InputBox("Your username is: " & username & ". Please enter a password")
  20.  
  21. filename = InputBox("Please enter your username")
  22.  
  23. FileOpen(1, username & "details.txt", OpenMode.Output)
  24. Print(1, username & vbCrLf & password)
  25. FileClose()
  26.  
  27. End Sub
  28.  
  29. Private Sub btnDetails_Click(sender As Object, e As EventArgs) Handles btnDetails.Click
  30. Dim userfile As String
  31. userfile = InputBox("Please enter you username.")
  32. Dim Lines As String() = System.IO.File.ReadAllLines(userfile)
  33. Dim secondline As String = Lines(1)
  34. Dim firstline As String = Lines(0)
  35.  
  36. txtPassword.Text = secondline
  37. txtUsername.Text = firstline
  38.  
  39. End Sub
  40.  
  41. Private Sub btnIn_Click(sender As Object, e As EventArgs) Handles btnIn.Click
  42. Dim username As String
  43. Dim password As String
  44. Dim username2 As String
  45. Dim password2 As String
  46. Dim passOK As Boolean
  47. passOK = False
  48.  
  49. username = txtUsername.Text
  50. password = txtPassword.Text
  51.  
  52. Do
  53. username2 = InputBox("Please enter your username.")
  54. If username2 <> username Then MsgBox("Wrong, try again!")
  55. Loop Until username2 = username
  56. MsgBox("Matching username")
  57.  
  58. Do
  59. password2 = InputBox("Please enter your password")
  60. If password2 <> password Then MsgBox("Password do not match. Please try again")
  61. Loop Until password2 = password
  62. passOK = True
  63.  
  64. If passOK = True Then MsgBox("Well done you have signed in.")
  65.  
  66.  
  67.  
  68.  
  69. End Sub
  70.  
  71. Private Sub btnQuiz_Click(sender As Object, e As EventArgs) Handles btnQuiz.Click
  72.  
  73. End Sub
  74. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement