ILicenseManager.LockingCode

Fore Syntax

LockingCode(Var LockSelector: Integer): String;

Fore.NET Syntax

LockingCode(LockSelector: Int32): String;

Parameters

LockSelector. Value of a set of criteria (UiLicenseLockSelector). By default, in order to generate locking code, the following criteria should be used: Disk ID and HostName.

Description

The LockingCode method returns locking code of the license to the computer.

Comments

To use several criteria, sum them. The code is formed based on the selected criteria.

Fore Example

To execute the example, place the Button component named Button1 on the form.

Add links to the Host, Ui, Forms system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    LicManager: ILicenseManager;
    Selector: integer;
    Code: String;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Selector := UiLicenseLockSelector.HostName + UiLicenseLockSelector.DiskID;
    Code := LicManager.LockingCode(Selector);
    WinApplication.InformationBox(Code);
End Sub Button1OnClick;

After executing the example, clicking the button displays a message with a license locking code.

Fore.NET Example

To execute the example, place the Button component named Button1 on the form.

Add links to the Host, Ui, Fore, ForeSystem system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Imports Prognoz.Platform.Interop.Host;
Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.Fore;
Imports Prognoz.Platform.Interop.ForeSystem;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var 
    WinApp: WinApplicationClassClass = 
New WinApplicationClassClass();
    Svc: IForeServices;
    RunContext: ForeRuntimeContext;
    LicManager: ILicenseManager;
    Selector: integer;
    Code: String;
Begin
    Svc := Self.Metabase 
As IForeServices;
    RunContext := Svc.GetRuntime().Context;
    LicManager := WinApp.Instance[RunContext].LicenseManager;
    Selector := (UiLicenseLockSelector.llsHostName 
As Integer) + (UiLicenseLockSelector.llsDiskID As Integer);
    Code := LicManager.LockingCode(
Var Selector);
    WinApp.InformationBox(Code, 
Null);
End Sub;

The example of Fore.NET example execution matches with that in the Fore example.

See also:

ILicenseManager