?? unit1.~pas
字號(hào):
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('密碼錯(cuò)誤或用戶不存在!');
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('密碼錯(cuò)誤或用戶不存在!');
edit1.Visible:=true;
edit2.Visible:=true;
edit1.Text:='';
edit2.Text:='';
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
begin
Form1.Visible:=false;
Form11.show;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -