OPC Studio User's Guide and Reference
RegisterFileWithExistenceCheck Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.ComponentModel Namespace > LicensingManagement Class : RegisterFileWithExistenceCheck Method
Name of the licensing component for which the location of the license key should be registered. Consult the documentation for the value that corresponds to your product.

The value of this parameter cannot be null (Nothing in Visual Basic).

ID of the license key for whose location should be registered. Consult the documentation for the values to be used with your product.

The value of this parameter cannot be null (Nothing in Visual Basic).

The name of the file containing the license.

The value of this parameter cannot be null (Nothing in Visual Basic).

Registers a license key located in a file, checking whether the file exists.
Syntax
'Declaration
 
Public Sub RegisterFileWithExistenceCheck( _
   ByVal componentName As String, _
   ByVal licenseId As String, _
   ByVal filePath As String _
) 
'Usage
 
Dim instance As LicensingManagement
Dim componentName As String
Dim licenseId As String
Dim filePath As String
 
instance.RegisterFileWithExistenceCheck(componentName, licenseId, filePath)
public void RegisterFileWithExistenceCheck( 
   string componentName,
   string licenseId,
   string filePath
)
public:
void RegisterFileWithExistenceCheck( 
   String^ componentName,
   String^ licenseId,
   String^ filePath
) 

Parameters

componentName
Name of the licensing component for which the location of the license key should be registered. Consult the documentation for the value that corresponds to your product.

The value of this parameter cannot be null (Nothing in Visual Basic).

licenseId
ID of the license key for whose location should be registered. Consult the documentation for the values to be used with your product.

The value of this parameter cannot be null (Nothing in Visual Basic).

filePath
The name of the file containing the license.

The value of this parameter cannot be null (Nothing in Visual Basic).

Exceptions
ExceptionDescription
A license key file is already registered for componentName and licenseId.
The specified license key file does not exist or is not accessible.

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

An invalid Uniform Resource Identifier (URI) was detected.
Remarks

The same combination of componentName and licenseId must not (and cannot) be registered more than once. An attempt to do so will result in an System.ArgumentException. Be careful not to put the registration code into Web request handlers (without further logic) which are called repeatedly.

Requirements

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

See Also