学习风兄的,丢个注册机:
procedure TForm1.ButtonRegClick(Sender: TObject);
var
cz, strA, strB, strC : string;
sum, pos : integer;
begin
cz := editname.Text;
if cz ='' then exit;
for pos := 1 to length(cz) do
if (ord(cz[pos]) < $20) or (ord(cz[pos]) > $7E) then
begin
showmessage('请输入字母或者数字,不支持中文!');
exit;
end;
sum := ord(cz[1]) * length(cz) * $64;
strA := ' ' + intTostr(sum) + 'NoName SwordMan nOnAME';
strB := strA[$12] + (strA[$7]+strA[$8]) + strA[$9]+strA[$5] + strA[$3] +
strA[$1] + (strA[$14]+strA[$15]+strA[$16]+strA[$17]+strA[$18]) +
(strA[$D]+strA[$E]) + strA[$8];
for pos := 1 to length(strB) do
if (ord(strB[pos]) <> $20) then strC := strC + strB[pos];
if length(strC) < 14 then
begin
strC := strC + copy(strA, 7, 23);
strC := copy(strC, 1, 15) + 'bywjy';
end;
strA := copy(strC, 1, 5) + '-' + copy(strC, 5, 4) + '-' + copy(strC, 8, 4) +
'-' + copy(strC, 11, 4) + '-' + copy(strC, 14, 7);
editcode.Text := strA;
end;