?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, jpeg, ExtCtrls, XPMan, Menus;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
Image1: TImage;
Shape1: TShape;
Shape2: TShape;
XPManifest1: TXPManifest;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit4, Unit8;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if(trim(edit1.text)='') then
begin
showmessage('請輸入用戶名!');
edit1.setfocus;
exit;
end;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.Add('select * from 系統登錄 where passname='''+trim(edit1.text)+'''');
adoquery1.Open;
if adoquery1.recordcount=0 then
begin
showmessage('對不起,該用戶不存在!');
edit1.setfocus;
exit;
end
else
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.Add('select * from 系統登錄 where passname='''+trim(edit1.text)+''''+'and password='''+trim(edit2.text)+'''');
adoquery1.Open;
if adoquery1.recordcount=0 then
begin
showmessage('密碼不正確,請重新輸入!');
edit2.setfocus;
exit;
end
else
showmessage('登錄成功!');
form2.Show;
form2.Visible:=true;
form1.Visible:=false;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
application.Terminate;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -