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

📄 mainu.pas

📁 Delphi 7基础编程的源代码
💻 PAS
字号:
unit MainU;

interface

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

type
  TForm1 = class(TForm)
    SetButton: TButton;
    TestButton: TButton;
    Label1: TLabel;
    procedure SetButtonClick(Sender: TObject);
    procedure TestButtonClick(Sender: TObject);
  private
    { Private declarations }
  public
    Password:PChar;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function GetPassWord(word:PChar):Boolean;
far; external 'PassForm.dll';
function SetPassWord(word:PChar):Boolean;
far; external 'PassForm.dll';


procedure TForm1.SetButtonClick(Sender: TObject);
begin
  PassWord := StrAlloc(40);
  if SetPassWord(PassWord) = False then
    MessageDlg('PassWord is not set',mtInformation,[mbOK],0);
end;

procedure TForm1.TestButtonClick(Sender: TObject);
begin
  if PassWord = nil then
  begin
    MessageDlg('Set password first',mtInformation,[mbOK],0);
    SetButton.SetFocus;
    Exit;
  end;
  if GetPassword(PassWord) then
    Label1.Caption := 'You are Wellcome!'
  else
    Label1.Caption := 'Sorry,You are Invalid User.';  
end;

end.

⌨️ 快捷键说明

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