unit DengluUnit;

interface

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

type
  TDengLu = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    UseName: TEdit;
    PassWord: TEdit;
    BtnOK: TButton;
    BtnCancel: TButton;
    procedure BtnOKClick(Sender: TObject);
    procedure BtnCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DengLu: TDengLu;


const
  iusename='yonghu';      //定义用户名
  ipassword='12345';      //定义口令

implementation

{$R *.dfm}

procedure TDengLu.BtnOKClick(Sender: TObject);
begin
  if ( usename.text=iusename)and(password.text=ipassword) then
    MessageDlg('欢迎使用教师人事档案系统！', mtInformation, [mbOK], 0)
  else
    MessageDlg('对不起，您不是合法用户！请重新输入用户名和密码！', mtInformation, [mbOK], 0);
end;

procedure TDengLu.BtnCancelClick(Sender: TObject);
begin
  close;
end;

end.
