unit3.~pas

来自「商品管理系统是面向超市类的商品数据库管理系统。其主要功能包括用户购买商品」· ~PAS 代码 · 共 73 行

~PAS
73
字号
unit Unit3;

interface

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

type
  Tmpass = class(TForm)
    Bevel1: TBevel;
    Label1: TLabel;
    Label2: TLabel;
    OKBtn: TButton;
    CancelBtn: TButton;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    procedure CancelBtnClick(Sender: TObject);
    procedure OKBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  mpass: Tmpass;

implementation

uses maen;

{$R *.DFM}

procedure Tmpass.CancelBtnClick(Sender: TObject);
begin
   mpass.close;
end;

procedure Tmpass.OKBtnClick(Sender: TObject);
    var password:textfile;
        passwordstr:string;
        //name:string;
begin
   assignfile(password,'config.cfg');
   reset(password);
   readln(password,passwordstr);
   closefile(password);
  //name:=combobox1.Items;
   //if   then
   begin
      if edit1.text=passwordstr then
        begin
        modalresult:=mrok;
        form2.show;
        edit1.text:='';
        close;
        end
        else
       begin
      messagedlg('你没有权力进入!',mtwarning,[mbyes,mbno],0);
          mpass.hide;
        edit1.text:='';
        end ;
     {else
      begin
      messagedlg('你没有权力进入!',mtwarning,[mbyes,mbno],0);
      mpass.hide;
      end; }
  end;
    end;
end.

⌨️ 快捷键说明

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