Advertisement
TermSpar

Login

Dec 9th, 2015
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.58 KB | None | 0 0
  1. Public Class frmPracticeExam
  2.     Dim first As String
  3.     Dim middle As String
  4.     Dim last As String
  5.     Dim password As String
  6.     Dim passLast As String
  7.     Dim birthday As String
  8.     Dim IDCount As Integer
  9.     Dim id As Integer
  10.     Dim year As String
  11.     Dim address As String
  12.     Private Sub btnInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInfo.Click
  13.         birthday = txtBirth.Text.Split("/")(1).Substring(0, 2)
  14.         year = txtBirth.Text.Split("/")(2)
  15.         passLast = txtName.Text.Split(" ")(2)
  16.         IDCount = txtID.Text.Length
  17.         id = txtID.Text.Substring(IDCount - 2)
  18.         first = txtName.Text.Substring(0, 1)
  19.         middle = txtName.Text.Split(" ")(1).Substring(0, 1)
  20.         last = txtName.Text.Split(" ")(2).Substring(0, 3)
  21.         password = StrReverse(passLast)
  22.         address = txtAddress.Text & ", " & txtCity.Text
  23.         If year.Length < 4 Then
  24.             MsgBox("Year Incorrect")
  25.         End If
  26.         lblDisplay.Text = "Username: " & first & middle & last & vbNewLine & vbNewLine & "Password: " & password & birthday & id & vbNewLine & vbNewLine & "Address: " & address
  27.  
  28.     End Sub
  29.  
  30.     Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
  31.         Dim realPass As String
  32.         Dim userName As String
  33.         userName = first & middle & last
  34.         realPass = password & year
  35.         If txtPW.Text = realPass And txtUN.Text = userName Then
  36.             Me.BackColor = Color.Green
  37.             MsgBox("Correct")
  38.         End If
  39.     End Sub
  40. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement