# 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" %}

```csharp
// 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 %}

&#x20;

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/how-to/how-to-configure-and-test-maxdaysoffline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
