Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.14 KB

how-to-configure-and-test-maxdaysoffline.md

File metadata and controls

30 lines (21 loc) · 1.14 KB

How to configure and test MaxDaysOffline

MaxDaysOffline allows you to require your customers to go online every x days to perform server side license validation.

To test this feature without waiting a full day while being offline, add the following code to your application, after the license has been successfully validated:

{% code overflow="wrap" %}

// Assuming lv is an instance of the LicenseValidator class

lv.QlmLicenseObject.MaxDaysOffline = 0;
lv.QlmLicenseObject.SimulateNoConnectivity = true;
lv.QlmLicenseObject.OfflinePeriodExceededAction = EOfflinePeriodExceededAction.FireEvent;
lv.QlmLicenseObject.OfflinePeriodExceeded_Event += QlmLicenseObject_OfflinePeriodExceeded_Event;
lv.QlmLicenseObject.QlmTimerDelayStart = 1;
lv.QlmLicenseObject.QlmTimerFrequency = 1;


private void QlmLicenseObject_OfflinePeriodExceeded_Event(object sender, OfflinePeriodExceeded_EventArgs e)
{
   MessageBox.Show(e.errorMessage); 
}

{% endcode %}

With the code above, after about 1 minute from the execution of that code, the OfflinePeriodExceeded_Event will fire.

The settings above are to be used strictly for testing purposes.