License Methods
Method | Description |
---|---|
InitLicense |
Initializes license key and activate the SDK. |
GetDeviceUUID |
Gets the device uuid used for license activating. |
IsInstanceValid |
Gets whether the instance is valid when charging by concurrent instances count. |
SetDeviceFriendlyName |
Sets a human-readable name that identifies the device. |
SetLicenseCachePath |
Sets a directory path for saving the license cache. |
SetMaxConcurrentInstanceCount |
Sets the max concurrent instance count used for current device and process. |
GetInstancePoolStatus |
Gets a class to represent the status of an instance pool. |
GetIdleInstancesCount |
Deprecated |
InitLicenseFromServer |
Deprecated |
InitLicenseFromLicenseContent |
Deprecated |
OutputLicenseToString |
Deprecated |
InitDLSConnectionParameters |
Deprecated |
InitLicenseFromDLS |
Deprecated |
InitLTSConnectionParameters |
Deprecated |
InitLicenseFromLTS |
Deprecated |
InitLicense
Initializes license key and activate the SDK.
static EnumErrorCode Dynamsoft.DBR.BarcodeReader.InitLicense (string license, out string errorMsg)
Parameters
[in] licenseKey
<string> : The license key of Barcode Reader.
[out] errorMsg
<string> : The detailed error message.
Return Value
Returns error code (returns DBR_SUCCESS if the function operates successfully).
You can check errorMsg
to get detailed error message.
Code Snippet
string errorMsg;
BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
BarcodeReader reader = BarcodeReader.GetInstance();
if (reader != null)
{
// add further process
reader.Recycle();
}
GetDeviceUUID
Gets the device uuid used for license activating.
static string Dynamsoft.DBR.BarcodeReader.GetDeviceUUID(EnumDMUUIDGenerationMethod uuidGenerationMethod)
Parameters
[in] uuidGenerationMethod
The method used to generate the UUID.
Return Value
Returns the result UUID.
IsInstanceValid
Gets whether the instance is valid when charging by concurrent instances count.
int Dynamsoft.DBR.BarcodeReader.IsInstanceValid()
Return Value
Returns an int value indicating whether the instance is valid for running on concurrent instance mode.
- 0: The instance is not valid for running on concurrent instance mode.
- 1: The instance is valid for running on concurrent instance mode.
Remarks
This method is meaningful only when using a license charged by concurrent instances count.
SetDeviceFriendlyName
Sets a human-readable name that identifies the device.
static EnumErrorCode Dynamsoft.DBR.BarcodeReader.SetDeviceFriendlyName(string name)
Parameters
[in] name
The device alias.
Return Value
Returns error code (returns DBR_SUCCESS if the function operates successfully).
Code Snippet
string errorMsg;
BarcodeReader.SetDeviceFriendlyName("My-PC");
BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
BarcodeReader reader = BarcodeReader.GetInstance();
if (reader != null)
{
// add further process
reader.Recycle();
}
SetLicenseCachePath
Sets a directory path for saving the license cache.
static EnumErrorCode Dynamsoft.DBR.BarcodeReader.SetLicenseCachePath(string directoryPath)
Parameters
[in] directoryPath
The directory path where to save the license cache.
Return Value
Returns error code.
Code Snippet
string errorMsg;
BarcodeReader.SetLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE");
BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
BarcodeReader reader = BarcodeReader.GetInstance();
if (reader != null)
{
// add further process
reader.Recycle();
}
SetMaxConcurrentInstanceCount
Sets the max concurrent instance count used for current device and process.
static void Dynamsoft.DBR.BarcodeReader.SetMaxConcurrentInstanceCount(int countForThisDevice, int countForThisProcess)
static void Dynamsoft.DBR.BarcodeReader.SetMaxConcurrentInstanceCount(int countForThisDevice, int countForThisProcess, int timeout)
Parameters
[in] countForThisDevice
The maximum number of concurrent instances that the current device can run.
[in] countForThisProcess
The maximum number of concurrent instances that the current process can run.
[in] timeout
The maximum time (in milliseconds) to wait for an available authorization or instance when calling InitLicense, GetInstance, or Decode functions.
Code Snippet
string errorMsg;
int countForThisDevice = 1; // The count value should be set based on your purchased license count
int countForThisProcess = 1; // The count value should be set based on your purchased license count
BarcodeReader.SetMaxConcurrentInstanceCount(countForThisDevice, countForThisProcess);
BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
BarcodeReader reader = BarcodeReader.GetInstance();
// If no instance is available right away, the application will wait until one becomes available
if (reader != null)
{
// Add your code here to call decoding method, process barcode results and so on
// ...
// Recycle the instance to make it idle for other concurrent tasks
reader.Recycle();
}
GetInstancePoolStatus
Gets a class to represent the status of an instance pool.
static InstancePoolStatus Dynamsoft.DBR.BarcodeReader.GetInstancePoolStatus()
Return Value
Returns the InstancePoolStatus
class representing the status of an instance pool.
GetIdleInstancesCount
Deprecated
. It still works in this version but could be removed in the near future.
static int Dynamsoft.DBR.BarcodeReader.GetIdleInstancesCount()
InitLicenseFromServer
Deprecated
. It still works in this version but could be removed in the near future.
int Dynamsoft.DBR.BarcodeReader.InitLicenseFromServer(string licenseServer, string licenseKey)
InitLicenseFromLicenseContent
Deprecated
. It still works in this version but could be removed in the near future.
int Dynamsoft.DBR.BarcodeReader.InitLicenseFromLicenseContent(string licenseKey, string strLicenseContent)
OutputLicenseToString
Deprecated
. It still works in this version but could be removed in the near future.
string Dynamsoft.DBR.BarcodeReader.OutputLicenseToString()
InitDLSConnectionParameters
Deprecated
. It still works in this version but could be removed in the near future.
static DMDLSConnectionParameters Dynamsoft.DBR.BarcodeReader.InitDLSConnectionParameters()
InitLicenseFromDLS
Deprecated
. It still works in this version but could be removed in the near future.
static EnumErrorCode Dynamsoft.DBR.BarcodeReader.InitLicenseFromDLS(DMDLSConnectionParameters dlsConnectionParameters, out string errorMsg)
InitLTSConnectionParameters
Deprecated
. It still works in this version but could be removed in the near future.
InitLicenseFromLTS
Deprecated
. It still works in this version but could be removed in the near future.