IsGenuine daysBetweenChecks parametersAnswered

Hello again.

I have a question regarding the daysBetweenChecks parameters to the IsGenuine method provided in the TurboActivate.cs file of the .NET TurboActivate package.

We do not wish to check for activation at regular interval. Once our applications are activated, they will stay activated (we only sell perpetual licenses and functionality never change). Can we pass a value to daysBetweenChecks (like zero or -1) to instruct TurboActivate to never check for activation again?

Thanks.

Just use IsActivated() instead of IsGenuine() / IsGenuineEx().

IsActivated() will only verify the activation offline (using the cryptographic signature verification) without contacting the servers.

So basically, as simple as wrapping the code to test for activation in a IsActivated() if block, like so (from your sample app):

if (!TurboActivate.IsActivated()) { // Check if we're activated, and every 90 days verify it with the activation servers // In this example we won't show an error if the activation was done offline // (see the 3rd parameter of the IsGenuine() function) -- http://wyday.com/limelm/help/offline-activation/ IsGenuineResult gr = TurboActivate.IsGenuine(90, 14, true);

isActivated = gr == IsGenuineResult.Genuine || gr == IsGenuineResult.GenuineFeaturesChanged ||

// an internet error means the user is activated but // TurboActivate failed to contact the LimeLM servers gr == IsGenuineResult.InternetError;

if (gr == IsGenuineResult.InternetError) { //TODO: give the user the option to retry the genuine checking immediately // For example a dialog box. In the dialog call IsGenuine() to retry immediately } } else isActivated = true; } catch (TurboActivateException ex) { MessageBox.Show("Failed to check if activated: " + ex.Message + ". Application will now close."); }

ShowTrial(!isActivated);

Do you see any issues running this code?

Thanks.

Answer

If you don't want IsGenuine() then you don't have to call it at all. The code you posted won't do anything bad, but it's largely redundant. Here's a better version:

...




  if (!TurboActivate.IsActivated())  {    //TODO: prompt the user for a product key,	// Launch the TurboActivate wizard, or just exit your app	// Whatever you want to do when a user isn't activated.  }  else    isActivated = true;}catch (TurboActivateException ex){    MessageBox.Show("Failed to check if activated: " + ex.Message + ". Application will now close.");}


ShowTrial(!isActivated);

Excellent. Thank you!