IUiLicenseManager.LockingCode

Fore Syntax

LockingCode(Var LockSelector: Integer): String;

Fore.NET Syntax

LockingCode(LockSelector: Int32): String;

Parameters

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

Description

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

Comments

To use several criteria, they should be summed up. The code is generated based on the selected criteria.

Fore Example

To execute the example, add a link to the Ui system assembly.

Sub UserProc;
Var 
    LicManager: IUiLicenseManager;
    Selector: integer;
    Code: String;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Selector := UiLicenseLockSelector.HostName + UiLicenseLockSelector.DiskID;
    Code := LicManager.LockingCode(Selector);
    WinApplication.InformationBox(Code);
End Sub UserProc;

Executing the example returns a message containing license locking code.

Fore.NET Example

To execute the example, add links to the Ui, Fore, ForeSystem system assemblies. The specified procedure is an entry point for the .NET assembly. The example of the Fore.NET example execution matches with that in the Fore example.

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

...

Public Shared Sub Main(Params: StartParams);
Var 
    WinApp: WinApplicationClassClass = New WinApplicationClassClass();
    Svc: IForeServices;
    RunContext: ForeRuntimeContext;
    LicManager: IUiLicenseManager;
    Selector: integer;
    Code: String;
Begin
    Svc := Params.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;

See also:

IUiLicenseManager