程序中添加动态用户密码

程序中往往会设置一个超级管理员工号,而这个工号是不写入数据库,直接编译在程序中,
这样做的目的一是为了方便了。
思路很简单:添加sa,密码为系统当前日期的月*日,然后在加上一常数888888。
如果输入密码正确,直接跳转到用户与密码判断语句之后。
 1string ls_pass,ls_s1,ls_s2;
 2int month_m,month_d,li_a,li_p;
 3month_m=month(today());
 4month_d=day(today());
 5ls_s1=right(string(month_m),1);
 6ls_s2=right(string(month_d),1);
 7ls_pass = string(month_m*month_d+888888);   //密码的生成
 8li_a = len(sle_code.text);
 9li_p = len(sle_pass.text); 
10 //apptemp.opercode与apptemp.operpass 为输入值 
11if apptemp.opercode = 'sa' and apptemp.operpass = ls_pass
12{       
13       apptemp.opername = "管理员";
14        goto ok ;    //直接跳转判断语句之后
15 }
posted @ 2006-05-21 09:16  zjy  阅读(651)  评论(2编辑  收藏  举报