vb三次输错密码则退出程序
PrivateSubForm_Load()Text1.Text=""Text1.MaxLength=8Text1.PasswordChar="*"Label2.Capti...
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 8
Text1.PasswordChar = "*"
Label2.Caption = ""
Label1.Alignment = 2
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "12345678" Then
Label2.Caption = "欢迎光临!"
Else
Label2.Caption = "密码不符,请重新输入!"
Text1.Text = ""
End If
End If
End Sub
在我现在的基础上,再更改成.三次输入错误密码则在label2.caption显示非法用户,请退出程序.
并退出程序 展开
Text1.Text = ""
Text1.MaxLength = 8
Text1.PasswordChar = "*"
Label2.Caption = ""
Label1.Alignment = 2
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "12345678" Then
Label2.Caption = "欢迎光临!"
Else
Label2.Caption = "密码不符,请重新输入!"
Text1.Text = ""
End If
End If
End Sub
在我现在的基础上,再更改成.三次输入错误密码则在label2.caption显示非法用户,请退出程序.
并退出程序 展开
1个回答
展开全部
Hi me
I can do it for you.
Dim passtime as integer
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 8
Text1.PasswordChar = "*"
Label2.Caption = ""
Label1.Alignment = 2
passtime=0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
passtime=passtime+1
'----无论密码对不对只要回车都增加一个次数
if passtime>3 then
label2.caption="显示非法用户,请退出程序."
exit sub
unload me
end
end if
'--这一段就是判断密码次数的
If Text1.Text = "12345678" Then
Label2.Caption = "欢迎光临!"
Else
Label2.Caption = "密码不符,请重新输入!"
Text1.Text = ""
End If
End If
End Sub
I can do it for you.
Dim passtime as integer
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 8
Text1.PasswordChar = "*"
Label2.Caption = ""
Label1.Alignment = 2
passtime=0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
passtime=passtime+1
'----无论密码对不对只要回车都增加一个次数
if passtime>3 then
label2.caption="显示非法用户,请退出程序."
exit sub
unload me
end
end if
'--这一段就是判断密码次数的
If Text1.Text = "12345678" Then
Label2.Caption = "欢迎光临!"
Else
Label2.Caption = "密码不符,请重新输入!"
Text1.Text = ""
End If
End If
End Sub
力控科技
2024-12-19 广告
2024-12-19 广告
第一步:看XPE是什么版,如果内核是英文版,需要安装一个MUI包,即语言包。第二步:进入控制面板-区域和语言选项,如下图,在区域选项中,选择“中文(中国)”,位置也为“中国”,在高级选项中,代码页转换表中,将所有的“简体中文”都选择上。...
点击进入详情页
本回答由力控科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询