很烂的问题

maxbookey 2004-10-29 07:48:15
求一段用户登陆时3次密码错误就退出的代码?
...全文
69 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hyf_0023 2004-10-30
  • 打赏
  • 举报
回复
主要是实例变量的思想,不光这个问题,很多问题都要注意运用实例变量,全局变量的思想。
tw829 2004-10-30
  • 打赏
  • 举报
回复
先声明实例变量:ii_sum
再在按钮里写

if ii_sum=3 then
messagebox("-_-","沒辦法,你輸三遍都還不會,我也沒辦法,算了,你辭職吧,就算是為社會作點貢獻咯!")
return
else
string ls_user = textUser.text
string ls_passwd_input = textpasswd.text
string ls_passwd_db
//然后用sql在数据库里通过用户名取出口令
if ls_passwd_input = ls_passwd_db then
//登录你的窗口吧
else
messagebox("笨牛","口令錯了,再輸錯,就會被炒魷魚的!")
ii_sum++
return
end if
end if
tw829 2004-10-30
  • 打赏
  • 举报
回复
先声明实例变量:ii_sum
再在按钮里写

if ii_sum=3 then
messagebox("提示","蠢豬,输三遍都還不对,給我滚!")
return
else
string ls_user = textUser.text
string ls_passwd_input = textpasswd.text
string ls_passwd_db
//然后用sql在数据库里通过用户名取出口令
if ls_passwd_input = ls_passwd_db then
//登录你的窗口吧
else
messagebox("提示","口令不对")
ii_sum++
return
end if
end if
  • 打赏
  • 举报
回复
先声明实例变量:ii_sum
...........

xiaotubie 2004-10-29
  • 打赏
  • 举报
回复
先声明实例变量:ii_sum
再在按钮里写

if ii_sum=3 then
messagebox("提示","笨蛋一个,输三遍都不对,滚回去")
return
else
string ls_user = textUser.text
string ls_passwd_input = textpasswd.text
string ls_passwd_db
//然后用sql在数据库里通过用户名取出口令
if ls_passwd_input = ls_passwd_db then
//登录你的窗口吧
else
messagebox("提示","口令不对")
ii_sum++
return
end if
end if
maxbookey 2004-10-29
  • 打赏
  • 举报
回复
不行呀
li_num并不会自增呀
ropriest 2004-10-29
  • 打赏
  • 举报
回复
说明:
因为你没次点确定按钮,如果通过密码验证就会打开主窗口,而没通过就会执行多次li_num++,只要判断li_num=3就行了
ropriest 2004-10-29
  • 打赏
  • 举报
回复
很简单阿,只要在登陆窗口中的确定按钮定义int变量li_num
然后设置
li_num++;
If li_num=3 Then
MessageBox("","")
Close(Parent)
End If

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧