One Time Online Activation
Hi,
another question is how would I implement one time activation meaning the user has to be online once and activate his program with an activation key but my software will not keep checking online if the licenses is valid.
Obviously I'll have to save the information that the software has been activated once already on the users computer. Is this feature already implemented in some way?
-
Official comment
Hi Nicholas
This is the default behavior of QLM. Once you activate, QLM no longer needs to connect to the License Server. QLM stores information on the local system and uses this information subsequently to ensure that the license is valid.
You could add some code to ping the license server occasionally and check that the license has not been revoked, but the default behavior does not connect to the server at all after initial activation.
Regards
John
Comment actions -
Hi Nicholas
Correct, ActivateLicense calls the server but ValidateLicenseEx does not. In general, any method that takes as a first argument the URL to the server calls the server. Any method that does not have the URL to the server as a the first argument does not call the server.
I'm not what your other question is. Could you elaborate please?
John
-
Sure, but this is probably redundant. :-)
Lets say somebody installs my application, then the Validate function gets called and obviously fails. So it gets an Activation Key (from the user) and then calls ActivateLicense. Nothing special till this point.
But if ActivateLicense fails now, I need to know for what reason it failed. As far as I can see the only information I can get about the reason is the response string.
First question is aren't there any error codes?
As far as I can see there aren't any, so I would need a list of the possible response strings.
The reason for this is just, that if the ActivateLicense fails because of invalid or already in use ActivationKey I would reject the user from using the application. But if the reason is proxy related or unreachable server I would allow the user to use the software and check later again hoping the server got reachable. -
Hi Nicholas
The response that you get back from the server will contain more details about the reason of the failure. To parse the response, use the code below.
// assuming you called ActivateLicense and you got a response back
ILicenseInfo li = new LicenseInfo ();
string message = string.Empty;
if (license.ParseResults (response, ref li, ref message))
{
}else
{
// you will end up here if there's an error. The "message" provides details about the reason for failure
}
-
Yes but the problem is I want to write code which reacts differently depending on the kind of error. So I need to know what messages could come when I'm writing my code.
If there are error codes I could do this for example:
Codes:
1 = No connection
2 = Invalid Activation Key
3 = Server Timeout
...
and then I would write code like
if (errorCode == 1)
// do this
else if (errrodCode == 2)
// do something different
Now as far as I can see there are no error codes. So I need a different approach. Maybe you could give me a list of all the possible error messages. Something like
" Couldn't connect to the server. "
" The activation key was invalid. "
" The server timed out after xxx seconds. "
Then I could write code like
if (errorMessage == " Couldn't connect to the server. ")
// do this
else if (errorMessage == " The activation key was invalid. ")
// do something different
Thanks in advance
Please sign in to leave a comment.
Comments
8 comments