?? unit22.pas
字號(hào):
unit Unit22;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TF_login = class(TForm)
ComboBox1: TComboBox;
Edit1: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Label2: TLabel;
procedure FormShow(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_login: TF_login;
implementation
uses unit1;
{$R *.dfm}
procedure TF_login.FormShow(Sender: TObject);
begin
mainform.A_rs.First;
ComboBox1.Items.Clear;
while mainform.A_rs.eof=false do
begin
ComboBox1.Items.add(mainform.A_rs.Fieldbyname('姓名').asstring);
mainform.A_rs.next;
end;
combobox1.ItemIndex:=0;
end;
procedure TF_login.BitBtn2Click(Sender: TObject);
begin
mainform.close;
end;
procedure TF_login.BitBtn1Click(Sender: TObject);
begin
with mainform.Q_temp do
begin
close;
sql.Clear;
sql.Add('select * from 人事庫(kù)');
sql.Add('where 姓名='+''''+ComboBox1.text+'''');
open;
end;
if mainform.Q_temp.Fieldbyname('口令').asstring=edit1.text then
begin
close;
end else
begin
application.MessageBox('口令無(wú)效,請(qǐng)重新輸入','系統(tǒng)信息',MB_OK+MB_Iconquestion);
edit1.SetFocus;
end;
end;
procedure TF_login.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
begin
with mainform.Q_temp do
begin
close;
sql.Clear;
sql.Add('select * from 人事庫(kù)');
sql.Add('where 姓名='+''''+ComboBox1.text+'''');
open;
end;
if mainform.Q_temp.Fieldbyname('口令').asstring=edit1.text then
begin
close;
end else
begin
application.MessageBox('口令無(wú)效,請(qǐng)重新輸入','系統(tǒng)信息',MB_OK+MB_Iconquestion);
edit1.SetFocus;
end;
end;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -