uflash.pas

来自「Delphi学籍管理程序,以Delphi7.0为前台开发工具」· PAS 代码 · 共 63 行

PAS
63
字号
unit uFlash;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, uGlobe;

type
  TfFlash = class(TForm)
    Image1: TImage;
    Timer: TTimer;
    lState: TLabel;
    procedure TimerTimer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function Login: Boolean;

implementation

uses uDM, uLoginPrompt;

{$R *.dfm}

function Login: Boolean;
begin
  with TfFlash.Create(Application) do
    try
      Result := ShowModal = mrOK;
    finally
      Free;
    end;
end;

procedure TfFlash.TimerTimer(Sender: TObject);
begin
  Timer.Enabled:=False;

  lState.Caption := '正在连接数据库...';
  Self.Update;

  if not OpenConnection(ConStr) then begin
    ModalResult:=mrCancel;
    Exit;
  end;

  lState.Caption := '正在验证用户身份...';
  Self.Update;

  if not LoginPrompt then begin
    ModalResult:=mrCancel;
    Exit;
  end;

  ModalResult := mrOk;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?