?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, StdCtrls,unit2,unit3;
type
TFormLogin = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Query1: TQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormLogin: TFormLogin;
implementation
{$R *.dfm}
procedure TFormLogin.Button1Click(Sender: TObject);
var user,pass:String;
begin
user:=Edit1.Text;
pass:=Edit2.Text;
Query1.SQL.Text:='Select * From 密碼.db Where 學號 = "'+user+'"';
Query1.Open;
if pass=Query1.FieldByName('密碼').AsString then
begin
Query1.Close;
FormLogin.Hide;
if user='0000' then
begin
FormMaster.Init;
FormMaster.Show;
end
else
begin
FormStuMain.User:=user;
FormStuMain.Init;
FormStuMain.Show;
end;
end
else
begin
Query1.Close;
ShowMessage(' 密碼錯誤!');
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -