📄 screenprotect.pas
字号:
unit ScreenProtect;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, jpeg;
type
TFrm_ScreenProtect = class(TForm)
Image1: TImage;
Edt_id: TEdit;
edt_passwd: TEdit;
Btn_ok: TButton;
Edit3: TEdit;
Edit4: TEdit;
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Btn_okClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_ScreenProtect: TFrm_ScreenProtect;
implementation
uses sys_dm;
{$R *.DFM}
var
M_passwd: string ;
procedure TFrm_ScreenProtect.FormCreate(Sender: TObject);
var
str: string ;
begin
str := ExtractFilePath(application.ExeName);
str := str + 'sun.jpg' ;
try
Image1.Picture.LoadFromFile(str); // 加载照片
except
messagebox(handle,' 没有图片文件sun.jpg', '提示', mb_ok+mb_iconstop);
exit;
end;
end;
procedure TFrm_ScreenProtect.FormShow(Sender: TObject);
begin
Frm_ScreenProtect.BorderStyle := bsNone ;
Frm_ScreenProtect.WindowState := wsMaximized ;
edt_id.text := '';
edt_passwd.text := '';
edt_id.SetFocus ;
end;
procedure TFrm_ScreenProtect.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
vk_return, vk_down:
selectnext(activecontrol as twincontrol, true, true);
vk_up:
selectnext(activecontrol as twincontrol, false, true);
end;
end;
procedure TFrm_ScreenProtect.Btn_okClick(Sender: TObject);
begin
with frm_sys_dm.qr_tmp1 do
begin
close;
sql.Clear ;
sql.text := 'select * from operator where id ='''+edt_id.text+'''' ;
open;
if eof then
begin
MessageBox(handle, ' 非法工号! ','提示', mb_ok+mb_iconstop);
edt_id.SetFocus ;
exit;
end;
M_passwd := fieldbyname('passwd').asstring ;
if edt_passwd.Text <> M_passwd then
begin
MessageBox(handle, ' 密码不对! ','提示', mb_ok+mb_iconstop);
Edt_passwd.SetFocus ;
exit;
end;
end;
close ;
end;
procedure TFrm_ScreenProtect.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_sys_dm.qr_tmp1.Close ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -