Skip to content

Commit eb053e0

Browse files
update to internal commit b852dce7
1 parent 7329c6c commit eb053e0

File tree

1 file changed

+57
-6
lines changed

1 file changed

+57
-6
lines changed

license-activation/index.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The following shows how to set the license in the code.
3838
>- Python
3939
>
4040
>
41-
```javascript
41+
```js
4242
Dynamsoft.License.LicenseManager.initLicense("YOUR-LICENSE-KEY");
4343
```
4444
>
@@ -60,10 +60,18 @@ Dynamsoft.License.LicenseManager.initLicense("YOUR-LICENSE-KEY");
6060
```
6161
>
6262
```csharp
63+
int errorCode = 0;
6364
string errorMsg;
64-
BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
65-
BarcodeReader reader = new BarcodeReader();
66-
// add further process
65+
errorCode = LicenseManager.InitLicense("--Enter Your License Key Here--", out errorMsg);
66+
if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
67+
{
68+
Console.WriteLine("License initialization error: " + errorMsg);
69+
}
70+
else
71+
{
72+
CaptureVisionRouter cvr = new CaptureVisionRouter();
73+
// add code for further process
74+
}
6775
```
6876
>
6977
```java
@@ -101,8 +109,13 @@ func onLicenseVerified(_ isSuccess: Bool, error: Error?) {
101109
```
102110
>
103111
```python
104-
error = BarcodeReader.init_license("YOUR-LICENSE-KEY")
105-
dbr = BarcodeReader()
112+
error_code = 0
113+
error_code, error_msg = LicenseManager.init_license("--Enter Your License Key Here--")
114+
if error_code != EnumErrorCode.EC_OK.value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED.value:
115+
print("License initialization error: " + error_msg)
116+
else:
117+
CaptureVisionRouter cvr = new CaptureVisionRouter()
118+
# add code for further process
106119
```
107120

108121
If you are using a **concurrent instance license**, you need to apply two more operations:
@@ -112,6 +125,8 @@ If you are using a **concurrent instance license**, you need to apply two more o
112125

113126
<div class="sample-code-prefix template2"></div>
114127
>- C++
128+
>- C#
129+
>- Python
115130
>
116131
>
117132
```cpp
@@ -131,3 +146,39 @@ If you are using a **concurrent instance license**, you need to apply two more o
131146
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &setting);
132147
// add further process
133148
```
149+
>
150+
```csharp
151+
int licenseCount = YOUR-PURCHASED-LICENSE-COUNT;
152+
int errorCode = 0;
153+
string errorMsg;
154+
errorCode = LicenseManager.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
155+
LicenseManager.SetMaxConcurrentInstanceCount(licenseCount)
156+
if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
157+
{
158+
Console.WriteLine("License initialization error: " + errorMsg);
159+
}
160+
else
161+
{
162+
CaptureVisionRouter cvr = new CaptureVisionRouter();
163+
SimplifiedCaptureVisionSettings settings;
164+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
165+
setting.maxParallelTasks = licenseCount;
166+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
167+
// add code for further process
168+
}
169+
```
170+
>
171+
```python
172+
license_count = YOUR-PURCHASED-LICENSE-COUNT
173+
error_code = 0
174+
LicenseManager.set_max_concurrent_instance_count(license_count)
175+
error_code, error_msg = LicenseManager.init_license("YOUR-LICENSE-KEY")
176+
if error_code != EnumErrorCode.EC_OK.value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED.value:
177+
print("License initialization error: " + error_msg)
178+
else:
179+
CaptureVisionRouter cvr = new CaptureVisionRouter()
180+
error_code, error_msg, settings = cvr.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
181+
settings.max_parallel_tasks = license_count
182+
error_code, error_msg = cvr.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
183+
# add code for further process
184+
```

0 commit comments

Comments
 (0)