?? loginunit.pas
字號:
unit loginUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, DB, ADODB, Mask, DBCtrls, StdCtrls, ExtCtrls;
type
TForm3 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
DataSource1: TDataSource;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ADOQuery1: TADOQuery;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses mainUnit;
{$R *.dfm}
procedure TForm3.SpeedButton1Click(Sender: TObject);
begin
if edit1.Text=''then
showmessage('用戶名不能為空')
else
begin
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from 管理員表');
sql.Add('where 姓名='+''''+edit1.text+'''');
// sql.Add('select * from 管理員表 where 姓名=edit1.text');
open;
if Fieldbyname('密碼').asstring=edit2.text then
form2.Show
else
begin
application.MessageBox('密碼無效,請重新輸入','系統信息',MB_OK+MB_Iconquestion);
edit2.SetFocus;
end;
end;
end;
end;
procedure TForm3.SpeedButton2Click(Sender: TObject);
begin
if messagedlg('你確認要退出嗎?',mtconfirmation,[mbyes,mbno],0)=mryes then
close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -