VFP系统登录代码怎么写?

如题所述

SELECT authdbf
LOCAL cname
cname=thisform.text1.Value
cpsd=thisform.text2.Value
IF EMPTY(cname).or.empty(cpsd)
MESSAGEBOX("用户名或密码不能为空,请重新输入",48,"系统提示")
thisform.text1.Value=""
thisform.text2.Value=""
thisform.text2.SetFocus
ELSE
go top
LOCATE for ALLTRIM(cname)=ALLTRIM(name)
SET EXACT ON
IF !FOUND()
MESSAGEBOX("用户不存在",46,"系统提示")
thisform.text1.Value=""
thisform.text2.Value=""
thisform.text2.SetFocus
ELSE
IF ALLTRIM(authdbf.psd)!=cpsd
cn=cn+1
nanswer=MESSAGEBOX("密码不正确,继续输入或退出?",4+32,"系统提示")
do case
CASE nanswer=6
thisform.text1.Value=""
thisform.text2.value=""
CASE nanswer=7
CLEAR EVENTS
QUIT
ENDCASE
thisform.text2.setfocus
IF cn=3
MESSAGEBOX("密码输入超过规定次数",48,"系统提示")
QUIT
ENDIF
ELSE
crealname=ALLTRIM(realname)
SELECT history
APPEND BLANK
replace history.hname with ALLTRIM(cname)
replace history.hlogintime with DATETIME()
replace history.hrealname with crealname
SELECT authdbf
do case
CASE authtype="管理员" &&&authno为权限表权限标记
auth=1
CASE authtype="业务员"
auth=2
ENDCASE
_screen.Visible= .T.
_screen.Left=0
_screen.Top=0
_screen.windowstate=2
thisform.Release
ENDIF
ENDIF
ENDIF
温馨提示:答案为网友推荐,仅供参考
第1个回答  2007-12-19
相似回答