DeployLX Software Protection System

NoLicenseException..::..ValidationRecords Property

Gets the collection of ValidationRecords that were collected during validation.

Syntax

Public ReadOnly Property ValidationRecords As ValidationRecordCollection
	Get
public ValidationRecordCollection ValidationRecords { get; }

Examples

This sample demonstrates how to catch the NoLicenseException and process the error.
Visual Basic
Imports DeployLX.Licensing.v5

...

Try
    _license = SecureLicenseManager.Validate(Me, Nothing, Nothing)
Catch ex As NoLicenseException
    ' A valid license was not found.
    Dim unlocked As Boolean = False
    For Each license As SecureLicense In ex.CheckedLicenses
        If license.CanUnlockBySerial AndAlso license.IsUnlocked Then
            unlocked = True
            Exit For
        End If
    Next license

    ' Make some assumptions about the possible errors, could check ValidationRecords
    ' for the exact cause(s).
    If unlocked Then
        ' The user has entered a serial number but something else caused the license validation
        ' to fail so display the actual error message to the user.
        MessageBox.Show(ex.Message)
    Else
        ' Still in trial mode so probably expired.
        MessageBox.Show("Please visit http://www.xheo.com to purchase a license.")
    End If
End Try
C#
using DeployLX.Licensing.v5;

...

try
{
    _license = SecureLicenseManager.Validate( this, null, null );
}
catch( NoLicenseException ex )
{
    // A valid license was not found.
    bool unlocked = false;
    foreach( SecureLicense license in ex.CheckedLicenses )
    {
        if( license.CanUnlockBySerial && license.IsUnlocked )
        {
            unlocked = true;
            break;
        }
    }

    // Make some assumptions about the possible errors, could check ValidationRecords
    // for the exact cause(s).
    if( unlocked )
        // The user has entered a serial number but something else caused the license validation
        // to fail so display the actual error message to the user.
        MessageBox.Show( ex.Message );
    else
        // Still in trial mode so probably expired.
        MessageBox.Show( "Please visit http://www.xheo.com to purchase a license." );
}

Assembly:  DeployLX.Licensing.v5 (in DeployLX.Licensing.v5.dll)

See Also