VB密码登陆代码

来源:百度知道 编辑:UC知道 时间:2024/05/21 19:41:33
我做的是输入密码正确时显示Form2同时隐藏Form1,要求输入错误时有提示重新输入,连续输错3次自动返回主界面!希望好心人附上代码,谢谢了!本人没学过VB 不要见笑!急!!!

for i=1 to 3
r=inputbox("请输入密码:")
if r 正确 then
form1.hide
form2.show
exit for
end if
next i
if i>3 then 主界面.show

static g as integer
private sub cmdlogin_click()
if text1.text="yonghu" and text2.text="mima" then
form1.hidden
form2.show
else
g=g+1
end sub

private sub form1_load()
if g=3 then
printf "你是非法用户"
end sub