Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub btnUp_Click(sender As Object, e As EventArgs) Handles btnUp.Click
- Dim username As String
- Dim fname As String
- Dim password As String
- Dim age As Integer
- Dim yrgroup As Integer
- Dim filename As String
- fname = InputBox("Please enter your first name")
- age = InputBox("Please enter your age")
- yrgroup = InputBox("Please ebter your year group")
- username = Mid$(fname, 1, 3) + Mid$(age, 1, 3)
- password = InputBox("Your username is: " & username & ". Please enter a password")
- filename = InputBox("Please enter your username")
- FileOpen(1, username & "details.txt", OpenMode.Output)
- Print(1, username & vbCrLf & password)
- FileClose()
- End Sub
- Private Sub btnDetails_Click(sender As Object, e As EventArgs) Handles btnDetails.Click
- Dim userfile As String
- userfile = InputBox("Please enter you username.")
- Dim Lines As String() = System.IO.File.ReadAllLines(userfile)
- Dim secondline As String = Lines(1)
- Dim firstline As String = Lines(0)
- txtPassword.Text = secondline
- txtUsername.Text = firstline
- End Sub
- Private Sub btnIn_Click(sender As Object, e As EventArgs) Handles btnIn.Click
- Dim username As String
- Dim password As String
- Dim username2 As String
- Dim password2 As String
- Dim passOK As Boolean
- passOK = False
- username = txtUsername.Text
- password = txtPassword.Text
- Do
- username2 = InputBox("Please enter your username.")
- If username2 <> username Then MsgBox("Wrong, try again!")
- Loop Until username2 = username
- MsgBox("Matching username")
- Do
- password2 = InputBox("Please enter your password")
- If password2 <> password Then MsgBox("Password do not match. Please try again")
- Loop Until password2 = password
- passOK = True
- If passOK = True Then MsgBox("Well done you have signed in.")
- End Sub
- Private Sub btnQuiz_Click(sender As Object, e As EventArgs) Handles btnQuiz.Click
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement