| 发表于:2007-05-28 13:11:154楼 得分:0 |
msgbox "a " strmyusername = trim(cmbusername.text & " ") strmyusercode = getdmfromxm(strmyusername) msgbox "b " if strmyusername = "管理员 " then strmyusercode = "0 " end if msgbox "c " '检查正确的密码 if checkuser(strmyusername, txtpassword.text) = true then msgbox "d " '将代码放在这里传递 '成功到 calling 函数 '设置全局变量时最容易的 strmydwmc = struserbmmc call getloginbm msgbox "e " if instr(strcandobmdm, getdm(cmbbm.text)) <= 0 then msgbox "f " msgbox "用户[ " & strmyusername & "]没有被授权登陆到[ " & getmc(cmbbm.text) & "]! ", vbexclamation exit sub end if msgbox "g " savesetting "temp ", "部门 ", cmbbm.text savesetting "temp ", "用户 ", cmbusername.text loginsucceeded = true me.hide else msgbox "无效的密码,请重试! ", , "登录 " txtpassword.setfocus sendkeys "{home}+{end} " end if | | |
|