Grace days off line

Im writing an app that is allowed to go offline and the code I am using is below. I am using 1 and 1 in the IsGenuine call just for testing ultimately it will be 90, 14

gr = TurboActivate.IsGenuine(1, 1, True, True)If gr = IsGenuineResult.InternetError Then sMsg = "To ensure continued operation of XXX please ensure you connect to the internet before running XXX within this period." MessageBox.Show(sMsg)ElseIf gr = IsGenuineResult.NotGenuine Then Try If TurboActivate.IsActivated Then MessageBox.Show(GetLocalString("XXX has been unable to check the validity of your license via the internet and cannot continue. Please ensure your computer has an active internet connection and then re-start XXX."), "XXX") End End If Catch End TryEnd IfIsLimeActivated = (gr = IsGenuineResult.Genuine _ OrElse gr = IsGenuineResult.GenuineFeaturesChanged _ OrElse gr = IsGenuineResult.InternetError)

But what happens is, when you disconnect, it is ok for 2 days one day between checks is ok, and then the days grace shows the InternetError message above but on day 3 or afterwards it says NotGenuine even though it is activated and the internet is on. We just get the XXX has been unable to check message. What have I missed?

Neil Turp

That's the expected behavior. Why? Well, you set the days between checks to 1 and the grace period to 1, and 2 days have passed since your app was able to reverify with the servers. Thus it's not genuine anymore. It'll still be activated, but by using (1, 1 ...) as parameters you're saying you want the customer to check every single day and you only want to give them 1 day grace period.

Instead of showing "XXX has been unable to check the validity of your license ...", show a dialog that give the user either the ability to re-check immediately or exit your app.

Short answer: modify what happens in the if statement & change the parameters of IsGenuine to something like (30, 14)

Does that make sense?

I think so

<show a dialog that give the user either the ability to re-check immediately or exit your app.>

So the new dialog says "Try again" or "Quit". On "Try again", we try gr = TurboActivate.IsGenuine(30,14, true, true)

Is that right?

Almost. The "Try again" button would call IsGenuine() -- that is, the function with no parameters. Meaning it will retry immediately everytime that button is clicked.

Got it thanks.

Fantastic Sam. That worked a treat