Registriert seit: 8. Jun 2002
Ort: Herne
575 Beiträge
Delphi 3 Professional
|
15. Jun 2002, 10:35
Hier noch mal ein konkreter Code:
Code:
procedure TForm1.FormCreate(Sender: TObject);
var OK: Boolean;
reg:tregistry;
a:integer;
serial:string;
begin
REG := TRegistry.Create;
try
try
REG.RootKey := HKEY_CURRENT_USER;
if REG.OpenKey('\Software\SELF', True) then
begin
if REG.ValueExists('CODE??') then a:=StrToInt(REG.ReadString('CODE??'))
else a := 0;
REG.CloseKey;
end;
except
a := 0;
end;
finally
REG.Free;
if a=0 then
begin
serial:=inputbox('Seriennummer','Bitte geben sie ihre Seriennummer ein:','1234-1324-234');
if serial ='' then
application.Terminate else
begin
if CheckCode(serial,25, 7)=true then
begin
reg:=tregistry.Create;
reg.RootKey:=HKEY_CURRENT_USER;
if reg.OpenKey('\Software\SELF',True) then
begin
reg.WriteString('CODE??',serial);
reg.free;
end;
end;
end;
end else
begin
if CheckCode(inttostr(a),25, 7)= false then
begin
serial:=inputbox('Seriennummer','Bitte geben sie ihre Seriennummer ein:','1234-1324-234');
if serial ='' then
application.Terminate else
begin
if CheckCode(serial,25, 7)=true then
begin
reg:=tregistry.Create;
reg.RootKey:=HKEY_CURRENT_USER;
if reg.OpenKey('\Software\SELF',True) then
begin
reg.WriteString('CODE??',serial);
reg.free;
end;
end else application.Terminate;
end;
end;
end;
end;
end;
|
|
Zitat
|