预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共69页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

编号:时间:2021年x月x日书山有路勤为径学海无涯苦作舟页码:unitUnit1;interfaceusesWindowsMessagesSysUtilsVariantsClassesGraphicsControlsFormsDialogsStdCtrlsDBADODBjpegExtCtrls;typeTForm1=class(TForm)ADOConnection1:TADOConnection;ADOQuery1:TADOQuery;Edit1:TEdit;Edit2:TEdit;Button1:TButton;Button2:TButton;ADOTable1:TADOTable;Image1:TImage;Label1:TLabel;Label2:TLabel;Label3:TLabel;Label4:TLabel;Button3:TButton;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton3Click(Sender:TObject);private{Privatedeclarations}publiccount:integer;{Publicdeclarations}end;varForm1:TForm1;implementationusesUnit12Unit19;{$R*.dfm}procedureTForm1.Button1Click(Sender:TObject);varyonghu:string;beginyonghu:=trim(edit1.Text);//trim去除字符串空格count:=count+1;//登陆次数withadoquery1dobeginClose;SQL.Clear;SQL.text:='select*from用户信息表where用户名='''+yonghu+'''';open;if(adoQuery1.RecordCount<>0)and(edit2.Text<>'')and(adoQuery1.FieldByName('密码').AsString=edit2.Text)thenbeginifadoQuery1.FieldByName('是否管理员').AsString='True'thenbeginform12.SpeedButton1.Visible:=true;form12.Button13.Visible:=true;application.MessageBox('密码正确即将进入系统。''提示'mb_ok);form1.Hide;form12.Show;endelsebeginform12.SpeedButton1.Visible:=false;form12.Button13.Visible:=false;application.MessageBox('密码正确即将进入系统。''提示'mb_ok);form1.Hide;form12.Show;end;endelsebeginif(count=1)thenbeginapplication.MessageBox('用户名或密码错误还剩2次机会''提示'mb_ok);edit1.SetFocus;//光标是向左对齐的也就是在编辑框的最左边end;if(count=2)thenbeginapplication.MessageBox('您还有最后一次机会请仔细核对用户名和密码''提示'mb_ok);edit1.Clear;edit2.clear;edit1.SetFocus;