unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}Function CreateCode(name, encrypt_template:PChar; hardwareID:LongInt; otherinfo:Word): PChar; CDecl; external 'CodeGen.dll';
Function HexToInt(hexstring:PChar) : LongInt ; StdCall ; External 'CodeGen.dll';procedure TForm1.Button1Click(Sender: TObject);
var
name,template,mykey:string;
hardwareid:longint;
otherinfo:word;
begin
name:='test';
template:='11111111';
s:='4C82-DC47';
otherinfo:=0;
hardwareid:=hextoint(pchar(s));
edit4.Text:=inttostr(hardwareid);
mykey:=CreateCode(pchar(name),pchar(template),hardwareid,otherinfo);
ShowMessage(mykey);
end;end.程序运行不正常不能算出注册号来..请问各位这段程序是不是写的有问题啊.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}Function CreateCode(name, encrypt_template:PChar; hardwareID:LongInt; otherinfo:Word): PChar; CDecl; external 'CodeGen.dll';
Function HexToInt(hexstring:PChar) : LongInt ; StdCall ; External 'CodeGen.dll';procedure TForm1.Button1Click(Sender: TObject);
var
name,template,mykey:string;
hardwareid:longint;
otherinfo:word;
begin
name:='test';
template:='11111111';
s:='4C82-DC47';
otherinfo:=0;
hardwareid:=hextoint(pchar(s));
edit4.Text:=inttostr(hardwareid);
mykey:=CreateCode(pchar(name),pchar(template),hardwareid,otherinfo);
ShowMessage(mykey);
end;end.程序运行不正常不能算出注册号来..请问各位这段程序是不是写的有问题啊.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货