uses Pmain, yonghu;
{$R *.dfm}
procedure Tfmdenglu.FormActivate(Sender: TObject);
begin
datapath:=ExtractFilePath(application.ExeName)+'DataBase';
with table1 do
begin
close;
DatabaseName:=datapath;
tableName:='mimab.db';
Open;
end;
end;
procedure Tfmdenglu.SpeedButton1Click(Sender: TObject);
begin
if edit1.Text='' then
begin
messagebeep(0);
showmessage('你还没输入用户名,请先输入登录名!');
edit1.SetFocus;
exit;
end;
if edit2.Text='' then
begin
messagebeep(0);
showmessage('对不起登录系统不能用空密码,请输入密码');
edit2.SetFocus;
exit;
end;
if table1.Locate('yonghuming',edit1.Text,[locaseinsensitive]) then
begin
if edit2.Text=dbedit1.Text then
begin
table1.Close;
fmdenglu.Hide;
PfmMain:=TPfmMain.create(self);
try
PfmMain.showmodal;
finally
Pfmmain.free;
end;
exit;
end
else
begin
messagebeep(0);
showmessage('密码错误!请重新输入!');
edit2.Text:='';
edit2.SetFocus;
exit;
end;
end
else
begin
messagebeep(0);
showmessage('对不起!不存在此用户,请重新输入!');
edit1.SetFocus;
end;
end;
procedure Tfmdenglu.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfmdenglu.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
edit2.SetFocus;
messagebeep(0);
end;
end;
procedure Tfmdenglu.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>