Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frmPracticeExam
- Dim first As String
- Dim middle As String
- Dim last As String
- Dim password As String
- Dim passLast As String
- Dim birthday As String
- Dim IDCount As Integer
- Dim id As Integer
- Dim year As String
- Dim address As String
- Private Sub btnInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInfo.Click
- birthday = txtBirth.Text.Split("/")(1).Substring(0, 2)
- year = txtBirth.Text.Split("/")(2)
- passLast = txtName.Text.Split(" ")(2)
- IDCount = txtID.Text.Length
- id = txtID.Text.Substring(IDCount - 2)
- first = txtName.Text.Substring(0, 1)
- middle = txtName.Text.Split(" ")(1).Substring(0, 1)
- last = txtName.Text.Split(" ")(2).Substring(0, 3)
- password = StrReverse(passLast)
- address = txtAddress.Text & ", " & txtCity.Text
- If year.Length < 4 Then
- MsgBox("Year Incorrect")
- End If
- lblDisplay.Text = "Username: " & first & middle & last & vbNewLine & vbNewLine & "Password: " & password & birthday & id & vbNewLine & vbNewLine & "Address: " & address
- End Sub
- Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
- Dim realPass As String
- Dim userName As String
- userName = first & middle & last
- realPass = password & year
- If txtPW.Text = realPass And txtUN.Text = userName Then
- Me.BackColor = Color.Green
- MsgBox("Correct")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement