getpasswordu.pas

来自「Delphi basic program. Basic programing」· PAS 代码 · 共 54 行

PAS
54
字号
unit GetPasswordU;

interface

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

type
  TGetPasswordForm = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;

  private

    { Private declarations }
  public

    { Public declarations }
  end;

var
  GetPasswordForm: TGetPasswordForm;
  function GetPassWord(Password:PChar):Boolean;export;

implementation


{$R *.dfm}
function GetPassWord(Password:PChar):Boolean;
    var
    GetPasswordForm: TGetPasswordForm;
begin
    Result := False;
    GetPasswordForm := TGetPasswordForm.Create(Application);
    try
      with GetPasswordForm do
        if ShowModal =mrOK then
          if UpperCase (Edit1.Text) <> StrPas(StrUpper(Password)) then
            messageDlg('密码不正确!        ',mtWarning,[mbOK],0)
          else
            Result := True;
    finally
        GetPasswordForm.Free;
    end;
end;  



end.

⌨️ 快捷键说明

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