⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uloginprompt.pas

📁 Delphi学籍管理程序,以Delphi7.0为前台开发工具
💻 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 + -