Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Public Class Form1

Dim ID As String
Dim Pass As String
Dim count As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles ButtonOk.Click
ID = TextBoxID.Text
Pass = TextBoxPass.Text
count += 1
If ID = "Josh" And Pass = "Wakelin" Then
MsgBox("Welcome, Josh!")
ElseIf ID <> "Josh" And Pass = "Wakelin" Then
MsgBox("Incorrect ID.")
TextBoxPass.Text = Nothing
ElseIf ID = "Josh" And Pass <> "Wakelin" Then
MsgBox("Incorrect Password.")
TextBoxID.Text = Nothing
ElseIf ID <> "Josh" And Pass <> "Wakelin" Then
MsgBox("Incorrect ID and Password.")
TextBoxID.Text = Nothing
TextBoxPass.Text = Nothing
End If
If TextBoxID.Text <> "Josh" And Pass <> "Wakelin" Then
Label4.Text = Str(count)
End If
If Label4.Text = 3 Then
MsgBox("Sorry, access denied")
Application.Exit()
End If
End Sub

You might also like