📄 uregsoft.pas
字号:
unit uRegSoft;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Regware2, ExtCtrls;
type
TRegSoftFrm = class(TForm)
btnReg: TButton;
btnCancel: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
edtDDHName: TEdit;
edtPersonName: TEdit;
edtCode: TEdit;
lblExpired: TLabel;
Label6: TLabel;
edtAuthCode: TEdit;
RegwareII: TRegwareII;
procedure btnRegClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
RegSoftFrm: TRegSoftFrm;
implementation
{$R *.dfm}
procedure TRegSoftFrm.btnRegClick(Sender: TObject);
var
s: string;
begin
if not RegwareII.DoRegistration(edtDDHName.Text, edtPersonName.Text, edtCode.Text) then
begin
s := '输入注册码不正确,请检查!';
Application.MessageBox(PChar(s), PChar('输入错误'), MB_OK + MB_ICONINFORMATION);
end
else
begin
s := '注册成功!' + #13 + '注册信息为:' +
#13 + '组织名:' + RegwareII.License +
#13 + '注册人:' + RegwareII.Organization +
#13 + '注册码:' + RegwareII.RegCode +
#13 + '感谢您对我们的支持!请重新启动本程序。';
Application.MessageBox(PChar(s), PChar('注册成功'), MB_OK + MB_ICONINFORMATION);
Application.Terminate;
end;
end;
procedure TRegSoftFrm.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TRegSoftFrm.FormCreate(Sender: TObject);
begin
if RegwareII.Expired then
lblExpired.Caption := '已经超期,请注册。'
else
begin
if RegwareII.Registered then
begin
lblExpired.Font.Color := clBlack;
lblExpired.Caption := '已经注册!';
end
else
begin
lblExpired.Font.Color := clBlue;
lblExpired.Caption := '未注册,请注册!';
end;
end;
edtDDHName.Text := RegwareII.License;
edtPersonName.Text := RegwareII.Organization;
edtAuthCode.Text := RegwareII.GetIdeDiskSerialNumberEx;
edtCode.Text := RegwareII.RegCode;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -