1-) Why IsGenuineEX() returns OK even if the key is REVOKED or DEACTIVATED?2-) I activated app 10 minutes ago and i've internet connection. Why IsGenuineEx() returns OK?
This question is already answered in every Using TurboActivate article, as well as in the documentation for the code. So, since you're using C#, here's where you look: Using TurboActivate with C#
Scroll down a bit and you'll see a header "IsActivated(), IsGenuine(), IsGenuineEx()" where it explains how they work (and specifically why you're seeing what you're seeing).
There are 3 separate TurboActivate functions for checking whether a customer is activated or not:
- IsActivated() checks if the user is activated without contacting any servers (no internet connection needed ever). It does this by verifying the cryptographically signed "computer fingerprint".
- IsGenuine() contacts the LimeLM servers to see if the user is still activated (checks for revoked product keys, etc.) and whether features have changed. This function requires an active internet connection to succeed (or else you get IsGenuineResult.InternetError returned).
- IsGenuineEx() is a mix of the best parts of IsActivated() and IsGenuine(). In IsGenuineEx() you can specify how often to check with the LimeLM servers and all other times it verifies the activation locally. (Note: in C# IsGenuineEx() is the IsGenuine() function with the 4 parameters.)
Make sense?
DAYSBETWEENCHECKS = 14
OK, so then you know that IsGenuineEx() checks the servers every 14 days. It doesn't matter that you clicked "revoke" today if it already checked less than 14 days ago.
3-) Am I in grace period?
No, you're not. You said yourself: "I activated app 10 minutes ago and i've internet connection." 10 minutes is less than 14 days, thus IsGenuineEx() is doing what it was designed to do -- check the local activation without touching the internet.
4-) What I want is; If user has an internet connection, i want to check the license online. If they dont, then I'd like to give them a few days to use app without checking license online. But if the user has an internet connection (even if the user is in the grace perid) i'd like to check it online. How can I achieve this?
You can't and if you could, you shouldn't. That's bad design and punishes customers with active and open internet connections.
The way you're using IsGenuineEx() right now is the best way to do things. So, worst case scenario, let's say a fraudulent user uses a stolen credit card to buy your product. You revoke the key, and at the very best the fraudster gets to use your app for DaysBetweenChecks + GracePeriod days.