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

📄 unit8.~pas

📁 商品管理系统是面向超市类的商品数据库管理系统。其主要功能包括用户购买商品
💻 ~PAS
字号:
unit Unit8;

interface

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

type
  TForm8 = class(TForm)
    Edit1: TEdit;
    procedure FormActivate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form8: TForm8;
  inputtimes:integer;

implementation

uses Unit7, maen;

{$R *.DFM}

procedure TForm8.FormActivate(Sender: TObject);

  //inputstimes:integer;
begin
     edit1.text:='';
     inputtimes:=0;
end;

procedure TForm8.Button1Click(Sender: TObject);
var
   password1:textfile;
   passwordstr1:string;
   password:textfile;
   passwordstr:string;
   //inputstimes:integer;
begin
     if form8.Caption='经理输入密码' then
     begin
     assignfile(password,'config1.cfg');
     reset(password);
     readln(password,passwordstr);
     closefile(password);
     inputtimes:=inputtimes+1;
     if inputtimes<=3 then
       begin
           if edit1.Text=passwordstr then
               begin
                 form7.show;
                 close;
                end   else
               begin
                 edit1.Text:='';
                 showmessage('密码错误,请重新输入');
               end;
       end
    else
      begin
       showmessage('密码错误,你已经无权使用该系统');
       application.Terminate;
      end;
     end;

     if form8.Caption='管理员输入密码' then
     begin
     assignfile(password1,'config.cfg');
     reset(password1);
     readln(password1,passwordstr1);
     closefile(password1);
     inputtimes:=inputtimes+1;
     if inputtimes<=3 then
       begin
         if edit1.Text=passwordstr1 then
            begin
              form2.show;
              close;
            end else
            begin
             edit1.Text:='';
             showmessage('密码错误,请重新输入');
            end;
       end
    else
      begin
       showmessage('密码错误,你已经无权使用该系统');
       application.Terminate;
      end;
    end;
end;

procedure TForm8.Button2Click(Sender: TObject);
begin
  close;
end;

end.

⌨️ 快捷键说明

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