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

📄 regcode.pas

📁 飞恒进销存(超市批发)管理系统V5.1(含源程序) 语言:Delphi 6/7 相关控件:FastReport 2.4以上, Ehlib 3.4以上 1.数据库为fhe2db_V51.da
💻 PAS
字号:
unit RegCode;

interface

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

type
  TRegCodeForm = class(TForm)
    cmdReturn: TBitBtn;
    BitBtn1: TBitBtn;
    edtRegCode: TEdit;
    Label1: TLabel;
    lblHotelName: TLabel;
    lblHotelId: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    GroupBox1: TGroupBox;
    Copyright: TLabel;
    Comments: TLabel;
    Label6: TLabel;
    procedure FormShow(Sender: TObject);
    procedure cmdReturnClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RegCodeForm: TRegCodeForm;

implementation

uses datamodule1;

{$R *.DFM}

procedure TRegCodeForm.FormShow(Sender: TObject);
begin
  lblHotelName.Caption := dataE2.hotelname;
  lblHotelId.Caption := dataE2.hotelId;
  edtRegCode.text:=DataE2.ReadRegistry;

  if dataE2.hotelspe > 0 then
  begin
    edtRegCode.text:='*****-*****-*****';
    cmdReturn.caption:='已注册' end
  else
    edtRegCode.text:='';

  cmdReturn.Enabled :=not dataE2.hotelspe > 0;
end;

procedure TRegCodeForm.cmdReturnClick(Sender: TObject);
var
  sRegCode,newEncodekey:string;
begin
  with dataE2 do
  begin
    newEncodekey:=MacAddress;
    sRegCode:=RegisterCode(SerialNo(EncodeString(hotelname,newEncodeKey)),hotelId);
  end;

  if (EdtRegCode.text=sRegCode) and dataE2.WriteRegistry then
      application.MessageBox('恭喜,注册成功 !!!    ','注册',MB_OK+MB_ICONINFORMATION)
  else
    application.MessageBox('错误注册用户码 ???    ','注册',MB_OK+MB_ICONERROR);
  //edtRegcode.text:=sRegCode;
end;

procedure TRegCodeForm.BitBtn1Click(Sender: TObject);
begin
  close;
end;

end.

⌨️ 快捷键说明

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