Welcome, Guest
Username: Password: Remember me
General Forum discussions that don't fit in any of the other specific forum categories, help etc.
  • Page:
  • 1

TOPIC:

OnGuard license code validation and activation 3 hours 49 minutes ago #18826

  • tatamata
  • tatamata's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 38
  • Thank you received: 3
 

File Attachment:

File Name: ulicensema...23-2.txt
File Size:24 KB

Attached is my ULicenseManager unit for validation and activation of license codes generated by demo OnGUard code generation program in the CodeOcean.
You will see some terrible hacks inside, for example for proper interpretation of encoded dates. It should be probably much better to debug the OnGuard itself. But, hey, it works! :-)
You can use it something like this:
procedure TAboutForm.CheckLicense;
var
  LM: TLicenseManager;
  Details: string;
  NewCode: string;
begin
  LM := TLicenseManager.Create(Self);
  try
    if LM.ActivateLicense(EditLicenseCode.Text, EditMachineCode.Text, Details) then
    begin
      LabelLicenseStatus.Caption := 'License: VALID';
      MemoLicenseStatusDetails.Lines.Text := Details;
      MainForm.IsLicenseActive := True;

      // Critical update: Refresh license code from storage
      NewCode := ReadLicenseCode;  // Or use LM's method if available
      EditLicenseCode.Text := NewCode;  // Update UI with new license code
      {$IFDEF DebuggingMode}
      DebugLog('? UI License Code Updated: ' + NewCode);
      {$ENDIF}
    end
    else
    begin
      LabelLicenseStatus.Caption := 'License: INVALID';
      MemoLicenseStatusDetails.Lines.Text :=
        'Activation Failed' + sLineBreak + Details;
      MainForm.IsLicenseActive := False;
    end;
  finally
    LM.Free;
  end;
end;
       
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by tatamata.

OnGuard license code validation and activation 3 hours 33 minutes ago #18827

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1164
  • Thank you received: 177
Thanks Sir
We will test and report
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1