// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
using System;
using OpcLabs.EasyOpc.UA;
namespace UADocExamples.Licensing
{
partial class LicenseInfo
{
public static void SerialNumber()
{
// Instantiate the client object.
var client = new EasyUAClient();
// Obtain the serial number from the license info.
long serialNumber = (uint)client.LicenseInfo["Multipurpose.SerialNumber"];
// Display the serial number.
Console.WriteLine("SerialNumber: {0}", serialNumber);
// Determine whether we are running as demo or trial.
if ((1111110000 <= serialNumber) && (serialNumber <= 1111119999))
Console.WriteLine("This is a stock demo or trial license.");
else
Console.WriteLine("This is not a stock demo or trial license.");
}
}
}
# Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc
# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *
# Instantiate the client object.
client = EasyUAClient()
# Obtain the serial number from the license info.
serialNumber = client.LicenseInfo.get_Item('Multipurpose.SerialNumber')
# Display the serial number.
print('SerialNumber: ', serialNumber, sep='')
# Determine whether we are running as demo or trial.
if (1111110000 <= serialNumber) and (serialNumber <= 1111119999):
print('This is a stock demo or trial license.')
else:
print('This is not a stock demo or trial license.')
print()
print('Finished.')
' Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
Imports OpcLabs.EasyOpc.UA
Namespace Licensing
Friend Class LicenseInfo
Public Shared Sub SerialNumber()
' Instantiate the client object.
Dim client = New EasyUAClient()
' Obtain the serial number from the license info.
Dim serialNumber As Long = CUInt(client.LicenseInfo("Multipurpose.SerialNumber"))
' Display the serial number.
Console.WriteLine("SerialNumber: {0}", serialNumber)
' Determine whether we are running as demo or trial.
If (1111110000 <= serialNumber) And (serialNumber <= 1111119999) Then
Console.WriteLine("This is a stock demo or trial license.")
Else
Console.WriteLine("This is not a stock demo or trial license.")
End If
End Sub
End Class
End Namespace