📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Mask, DBCtrls, DB, DBTables, ADODB;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
BitBtn4: TBitBtn;
Edit1: TEdit;
Edit2: TEdit;
ADOTable1: TADOTable;
ADOTable2: TADOTable;
BitBtn5: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3, Unit4, Unit10, Unit11;
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
with dm.adoquery4 do
begin
close;
sql.clear;
sql.add('select * from PW where ID='''+Edit1.Text+'''');
open;
end;
if Edit1.Text='' then
application.MessageBox('用户名不能为空!','提示',mb_ok)
else if Edit2.Text='' then
application.messagebox('密码不能为空!','警告',mb_ok)
else if edit2.text=dm.adoquery4.fieldbyname('PW').asstring then
begin
Form1.Visible:=false;
Form4.Show;
end
else
showmessage('密码错误或用户不存在!');
edit1.Visible:=true;
edit2.Visible:=true;
edit1.Text:='';
edit2.Text:='';
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
form1.Visible:=false;
form3.show;
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
Form1.close;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
with dm.adoquery3 do
begin
close;
sql.clear;
sql.add('select * from ADPW where ID='''+Edit1.Text+'''');
open;
end;
if Edit1.Text='' then
application.MessageBox('用户名不能为空!','提示',mb_ok)
else if Edit2.Text='' then
application.messagebox('密码不能为空!','警告',mb_ok)
else if edit2.text=dm.adoquery3.fieldbyname('PW').asstring then
begin
Form1.Visible:=false;
Form2.Show;
end
else
showmessage('密码错误或用户不存在!');
edit1.Visible:=true;
edit2.Visible:=true;
edit1.Text:='';
edit2.Text:='';
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
begin
Form1.Visible:=false;
Form11.show;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -