Escolar Documentos
Profissional Documentos
Cultura Documentos
User's guide
Table of Contents
1 Preface
3 NLicManGenerateSerial@NUInt@NInt@NInt *@NChar
*@NSizeType
4
4
NLicManGetLongProductNameEx@NUInt@NLicenseType@N
Char
*@NSizeType
5
5
NLicManGetShortProductNameEx@NUInt@NLicenseType@N
Char
*@NSizeType
6 Introduction
7 API Reference
7.1.1 Functions
10
10
10
11
11
11
ii
11
11
12
NLicenseManager.DllName Field
12
12
NLicenseManager.FindFirstDongle Method
12
NLicenseManager.FindNextDongle Method
12
NLicenseManager.GenerateLicense Method
12
NLicenseManager.GenerateSerial Method
13
NLicenseManager.GetInfo Method
13
NLicenseManager.GetLicenseCount Method
13
NLicenseManager.GetLicenseData Method
14
NLicenseManager.GetLongProductName Method
14
NLicenseManager.GetProductIds Method
14
NLicenseManager.GetShortProductName Method
14
iii
1 Preface
2 NLicManGenerateLicense@NChar
*@NInt *@NUInt *@NChar *@NSizeType
Generates product license to specified memory buffer.
Parameters
Parameters
Description
pId
pSequenceNumber
pProductId
pLicBuf
licBufSize
Returns
If the function succeeds the return value is N_OK.
If pId , pLicBuf, pSerialNumber or pProductId is NULL an error code is returned.
Remarks
When generating licenses these constraints should be considered:
1. Only one instance of license generating process should be present.
2. pg.exe can not be started.
3
NLicManGenerateSerial@NUInt@NInt@N
Int
*@NChar *@NSizeType
Generates serial number for specified product.
Parameters
Parameters
Description
productId
pSequenceNumber
pDistributorId
pSnBuf
snBufLength
Returns
If the function succeeds the return value is N_OK.
If pSnBuf , pSerialNumber or pDistributorId is NULL or snBufLength is less than (N_LIC_MAN_MAX_SERIAL_LENGTH (
page 11) + 1) an error code is returned.
4
NLicManGetLongProductNameEx@NUIn
t@NLicenseType@NChar
*@NSizeType
Retrieves full name of a product specified by product Id.
Parameters
Parameters
Description
productId
type
szValue
valueSize
Returns
If the function succeeds the return value is N_OK.
Otherwise an error code is returned.
5
NLicManGetShortProductNameEx@NUIn
t@NLicenseType@NChar
*@NSizeType
Retrieves short name of a product specified by product Id.
Parameters
Parameters
Description
productId
type
szValue
pValue
Returns
If the function succeeds the return value is N_OK.
Otherwise an error code is returned.
6 Introduction
License Manager API is useful to develop your own license managing software. Neurotechnology can provide USB dongles
that contains amount of licenses of specified products. Dongle can be used to generate single computer licenses
independent from Neurotechnology.
Functions
7 API Reference
This chapter contains API reference which helps to develop licenses managing software.
Description
NLicManDongleGetDistributorId (
page 8)
NLicManFindNextDongle (
page 9) Finds next attached dongle. This function is used together with
NLicManFindFirstDongle ( page 8) function.
NLicManGetLicenseCountEx (
page 9)
NLicManGetLicenseData (
NLicManGetProductIds (
Macros
Name
Description
N_LIC_MAN_MAX_LICENSE_LENGTH (
page 10)
N_LIC_MAN_MAX_SERIAL_LENGTH (
11)
page
7.1.1 Functions
The following table lists functions in this documentation.
Functions
Name
Description
NLicManDongleGetDistributorId (
page 8)
NLicManFindNextDongle (
page 9) Finds next attached dongle. This function is used together with
NLicManFindFirstDongle ( page 8) function.
NLicManGetLicenseCountEx (
page 9)
Functions
Description
HNLicManDongle hDongle
NInt * pDistributorId
Returns
If the function succeeds the return value is N_OK.
If hDongle or pDistributorId is NULL an error code is returned.
If hDongle or pCount is NULL an error code is returned.
Remarks
To get Ids of all products use NLicManGetProductIDs function. Using functions NLicManGetLongProductName and
NLicManGetShortProductName you can get the name of product specified by Id.
Description
HNLicManDongle hDongle
NUInt productId
NLicenseType type
NInt * pCount
Returns
If the function succeeds the return value is N_OK.
If hDongle or pCount is NULL an error code is returned.
Remarks
To get Ids of all products use NLicManGetProductIDs function. Using functions NLicManGetLongProductName and
NLicManGetShortProductName you can get the name of product specified by Id.
Functions
C++
NResult N_API NLicManFindFirstDongle(HNLicManDongle * pHDongle);
Parameters
Parameters
Description
HNLicManDongle * pHDongle
Returns
If the function succeeds the return value is N_OK.
Remarks
NlmDongleFindNext and NLicManFindFirstDongle functions can be used to iterate through all attached dongles.
NlmDongleFindNext is used to get handles of all the subsequent dongles attached.
When dongle handle is no longer needed, it must be freed using NlmDongleFree.
page 8) function.
C++
NResult N_API NLicManFindNextDongle(HNLicManDongle * pHDongle);
Parameters
Parameters
Description
HNLicManDongle * pHDongle
Returns
If the function succeeds the return value is N_OK.
Description
NUInt productId
NLicenseType type
NInt * pCount
Returns
If the function succeeds the return value is N_OK.
If pCount is NULL an error code is returned.
See Also
NLicManGetProductIDs
Macros
C++
NResult N_API NLicManGetLicenseData(NChar * szId, NInt * pSequenceNumber, NUInt *
pProductId, NInt * pDistributorId);
Parameters
Parameters
Description
NInt * pSequenceNumber
NUInt * pProductId
NInt * pDistributorId
pId
Returns
If the function succeeds the return value is N_OK.
Description
NUInt * arProductsIds
Returns
If the function succeeds the return value is N_OK.
Otherwise an error code is returned.
7.1.2 Macros
The following table lists macros in this documentation.
Macros
Name
Description
N_LIC_MAN_MAX_LICENSE_LENGTH (
page 10)
N_LIC_MAN_MAX_SERIAL_LENGTH (
11)
page
C++
#define N_LIC_MAN_MAX_LICENSE_LENGTH 6400
10
Neurotec.Licensing Namespace
Namespaces
Name
Description
Neurotec.Licensing (
page 11)
Description
NLicenseManager (
page 11)
7.2.1.1 Classes
The following table lists classes in this documentation.
Classes
Name
Description
NLicenseManager (
page 11)
Description
page 12)
11
Neurotec.Licensing Namespace
NLicenseManager Methods
Name
Description
FindFirstDongle (
page 12)
FindNextDongle (
page 12)
GenerateLicense (
GenerateSerial (
GetInfo (
page 12)
page 13)
page 13)
GetLicenseCount (
GetLicenseData (
page 13)
page 14)
GetLongProductName (
GetProductIds (
page 14)
page 14)
GetShortProductName (
12
Neurotec.Licensing Namespace
C#
public static string GenerateLicense(string id, out int sequenceNumber, out uint productId);
Parameters
Parameters
Description
string id
Returns
If the method succeeds the return value is a string that contains generated license data.
Remarks
For every generated license count of licenses in a dongle will be decreased by 1.
When generating licenses these constraints should be considered:
1. Only one instance of license generating process should be present.
2. pg.exe can not be started.
Description
uint productId
int sequenceNumber
Returns
If the method succeeds a string which contains generated serial numer is returned.
13
Neurotec.Licensing Namespace
Parameters
Parameters
Description
uint productId
Returns
Returns license count left to generate for specified product (for non concurrent licenses only) and license count available.
Exceptions
Exceptions
Description
Exception
Description
string id
Product Id.
Distributor Id.
Description
uint productId
Returns
A string that contains full product name specified by productID.
14
Neurotec.Licensing Namespace
C#
[Obsolete("Use GetShortProductName(uint, NLicenseType) instead.")]
public static string GetShortProductName(uint productId);
Parameters
Parameters
Description
uint productId
Returns
A string that contains short product name.
15