?? uloginprompt.pas
字號:
unit uLoginPrompt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons;
type
TdlgLoginPrompt = class(TForm)
Image: TImage;
bbOK: TBitBtn;
bbCancel: TBitBtn;
bbEditPassword: TBitBtn;
lPassword: TLabeledEdit;
procedure bbEditPasswordClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function LoginPrompt: Boolean;
implementation
uses uDM, uGlobe, uEditPassword;
{$R *.dfm}
function LoginPrompt: Boolean;
var
dlgLoginPrompt: TdlgLoginPrompt;
begin
dlgLoginPrompt := TdlgLoginPrompt.Create(nil);
try
Result := False;
if dlgLoginPrompt.ShowModal = mrOK then begin
Result := dlgLoginPrompt.lPassword.Text = GetPassword;
if not Result then
MessageBox(Application.Handle, PChar('密碼錯誤!'), PChar('登錄錯誤'), 48);
end;
finally
FreeAndNil(dlgLoginPrompt);
end;
end;
procedure TdlgLoginPrompt.bbEditPasswordClick(Sender: TObject);
var psw: string;
begin
if not (lPassword.Text = GetPassword) then begin
MessageBox(Application.Handle, PChar('密碼錯誤!'), PChar('登錄錯誤'), 48);
exit;
end;
psw := lPassword.Text;
EditPassword(psw);
lPassword.Text := psw;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -