QuickOPC User's Guide and Reference
LicenseInfo Property (EasyUAClient)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace > EasyUAClient Class : LicenseInfo Property
Provides dictionary of license data fields and their values.
Syntax
'Declaration
 
Public ReadOnly Property LicenseInfo As StringObjectDictionary
'Usage
 
Dim instance As EasyUAClient
Dim value As StringObjectDictionary
 
value = instance.LicenseInfo
public StringObjectDictionary LicenseInfo {get;}
public:
property StringObjectDictionary^ LicenseInfo {
   StringObjectDictionary^ get();
}
Example
// Shows how to display all fields of the available license(s).

using System;
using System.Collections.Generic;
using OpcLabs.BaseLib.Collections.Specialized;
using OpcLabs.EasyOpc.UA;

namespace UADocExamples.Licensing
{
    partial class LicenseInfo
    {
        public static void AllFields()
        {
            // Instantiate the client object.
            var client = new EasyUAClient();

            // Obtain the license info.
            StringObjectDictionary licenseInfo = client.LicenseInfo;

            // Display all elements.
            foreach (KeyValuePair<string, object> pair in licenseInfo)
                Console.WriteLine($"{pair.Key}: {pair.Value}");
        }
    }
}
// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

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.

class procedure LicenseInfo.SerialNumber;
var
  Client: _EasyUAClient;
  SerialNumber: Int64;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  // Obtain the serial number from the license info.
  SerialNumber := Int64(client.LicenseInfo['Multipurpose.SerialNumber']);

  // Display the serial number.
  WriteLn('SerialNumber: ', SerialNumber);

  // Determine whether we are running as demo or trial.
  if ((1111110000 <= SerialNumber) and (SerialNumber <= 1111119999)) then
    WriteLn('This is a stock demo or trial license.')
  else
    WriteLn('This is not a stock demo or trial license.');
end;
// This example shows how to obtain nodes under a given node of the OPC-UA address space. 
// Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

// Instantiate the client object
$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

// Obtain the serial number from the license info.
$SerialNumber = $Client->LicenseInfo["Multipurpose.SerialNumber"];

// Display the serial number.
printf("SerialNumber: %s\n", $SerialNumber);

// Determine whether we are running as demo or trial.
if ((1111110000 <= $SerialNumber) and ($SerialNumber <= 1111119999))
    printf("This is a stock demo or trial license.\n");
  else
    printf("This is not a stock demo or trial license.\n");
Rem Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

Private Sub LicenseInfo_SerialNumber_Command_Click()
    OutputText = ""
        
    ' Instantiate the client object
    Dim client As New EasyUAClient

    ' Obtain the serial number from the license info.
    Dim serialNumber As Long
    serialNumber = client.LicenseInfo("Multipurpose.SerialNumber")
    
    ' Display the serial number.
    OutputText = OutputText & "Serial number: " & serialNumber & vbCrLf
    
    ' Determine whether we are running as demo or trial.
    If (1111110000 <= serialNumber) And (serialNumber <= 1111119999) Then
        OutputText = OutputText & "This is a stock demo or trial license." & vbCrLf
    Else
        OutputText = OutputText & "This is not a stock demo or trial license." & vbCrLf
    End If
End Sub
' Shows how to obtain the serial number of the active license, and determine whether it is a stock demo or trial license.

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
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2012 R2, Windows Server 2016; .NET: Linux, macOS, Microsoft Windows

See Also