내 로그인 기능에 로그인 시도 횟수를 추가하고 싶습니다. 사용자가 잘못된 사용자 이름과 암호를 세 번 입력하면 프로그램이 닫히고 메시지가 표시됩니다. 여기에서 로그인 버튼에 대한 내 코드에 내 Form1.vb
:로그인 시도 횟수를 계산하는 방법 Visual Basic
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "13Mendv" And TextBox2.Text = "Admin123" Or
TextBox1.Text = "Admin" And TextBox2.Text = "Admin123" Or
TextBox1.Text = "13PateS" And TextBox2.Text = "Staff123" Or
TextBox1.Text = "13KhetP" And TextBox2.Text = "Member123" Or
TextBox1.Text = "13PateN" And TextBox2.Text = "Scorer123" Or
TextBox1.Text = "13ChatP" And TextBox2.Text = "Captain123" Or
TextBox1.Text = "13BonnN" And TextBox2.Text = "Captain123" Or
TextBox1.Text = "13EarlJ" And TextBox2.Text = "Captain123" Or
TextBox1.Text = "13RajaA" And TextBox2.Text = "Captain123" Or
TextBox1.Text = "1" And TextBox2.Text = "1" Or
TextBox1.Text = "13SchaJ" And TextBox2.Text = "Captain123" Then
Timer1.Start() 'Timer on Form1.vb show
ProgressBar1.Show() 'Progress bar on Form1.vb show
Label8.Show() 'Label8 on Form1.vb show
Button4.Show() 'Button4 on Form1.vb show
Else
If TextBox1.Text = "" And TextBox2.Text = "" Then
MsgBox("No Username and/or Password Found!", MsgBoxStyle.Critical, "Error") 'If statement for checking if there is any input in either username or password entry field
Else
If TextBox1.Text = "" Then
MsgBox("No Username Found!", MsgBoxStyle.Critical, "Error") 'Message box no username found
Else
If TextBox2.Text = "" Then
MsgBox("No Password Found!", MsgBoxStyle.Critical, "Error") 'Message box no password found
Else
MsgBox("Invalid Username And/Or Password!", MsgBoxStyle.Critical, "Error") 'Message box invlaid username and or password
TextBox2.Clear()
End If
End If
End If
End If
End Sub
내가 제대로 3 로그인 시도 실패 자신의 사용자에게 통지 코드로 카운트를 추가하기 위해 무엇을 할 수 있는가?
'가'실패 개인 nCount 정수로 = 0' 각 시간 nCount = 1 '이 (3)에 – Plutonix
I를 얻을 때 다음 응용 프로그램을 종료 누군가 거기서 누군가 당신의 사용자 이름과 패스워드를 방송하는 것을 확신합니다. :) – cHao
도움을 주셔서 감사합니다. 매우 환영합니다. –