Creating Licenses
In order to create a new Thinfinity VirtualUI license you must use the corresponding CreateLicense method with the following parameters:
in
OEM-licensed Company´s e-mail
OEMKey
in
OEM Key.
CustomerID
in
Arbitrary customer identification for the new license. This can be an e-mail address, a serial number or any other customer identification.
Units
in
Number of units to enable in this license. Each unit contains a predefined number of concurrent users. If your OEM license has 5 users per unit, and you assign 2 units to the product license, the customer will have 10 concurrent users in total.
Serial
out
Serial number of the successfully generated license.
A call to the CreateLicense function will return one of the following error codes:
0
No error. The "Serial" parameter will contain the generated serial number.
-1
General error in license server.
-2
Incorrect Email or OEM Key.
-3
No more units available.
-4
OEM License expired.
-5
General error. Cannot create license.
-10
Invalid response received from license server.
-20
Malformed response received from license server.
-100
General error in library.
-101
Application invalid: not digitally signed.
>200
HTTP status code.
The following example shows how to create a license using Delphi. Please note that you must replace CreateLicenseW by CreateLicenseA when using ANSI chars.
procedure
CreateLicense;
var
result:
Integer
;
serial:
WideString
;
begin
serial := StringOfChar(' ', 128);
result := CreateLicenseW(
PChar
('OEM_EMAIL'),
PChar
('OEM_KEY'),
PChar
('CUSTOMER_ID'), UNIT_COUNT,
PWideChar
(serial));
// Check result
end
;
And this is how you create it using C#:
private
void
CreateLicense()
{
StringBuilder sn = new StringBuilder(128);
int
result = CreateLicenseW("OEM_EMAIL", "OEM_KEY",
"CUSTOMER_ID", UNIT_COUNT), sn);
string
serial = "";
// Check result
if
(result == 0)
{
serial = sn.ToString().Trim();
}
else
{
// Error
}
}
Note: In all these examples, please replace 'OEM_EMAIL' and 'OEM_KEY' with your Company's OEM registration, 'CUSTOMER_ID' with the Customer identification and 'UNIT_COUNT' with the desired value.
Read more:
· How to Create and Revoke Licenses
Last updated