GetExpiryDate ? how to get the expiry date c#
hello all
i got a key with expired date created with this function - CreateActivationKeyWithExpiryDate
or with
CreateComputerBoundTrialKey
how can i check in my program the expired date ?
i cant find the function or how to use public DateTime ExpiryDate { get; } to get it
any one has a example ?
thanks !
noam
-
Official comment
Hi Noam
To retrieve any attribute of a license key such as the expiry date, you must do the following:
1. Call DefineProduct with your product details
2. Call ValidateLicense or ValidateLicenseEx with the license key you created.
3. Call GetStatus and confirm that the license is valid
4. Then, if the license is valid, you can access any attribute of the license such as ExpiryDate, Duration, etc.
The first 3 steps described above are already performed for you in the LicenseValidator class that you can generated from the Protect Your Application Wizard.
You essentially create an instance of the LicenseValidator class, then you call ValidateLicenseAtStartup. If this is successful, you have taken care of steps 1, 2 and 3 above.
You will also find several useful properties in the LicenseValidator class such as IsEvaluation, EvaluationExpired, EvaluationRemainingDays.
Hope this helps.
John
Comment actions -
thanks the problem is
i create a key with API using CreateActivationKeyWithExpiryDate
then the function ValidateLicenseEx always return invalid
if i create a local key it doesnt help me because then it doesn't exist in the server
do i have a get status with api ?
i tried to check with IsLicenseKeyValid - got valid key
the getstatus alwyas return = 8
what am i doing wrong ?
-
Hi
I am calling DefineProduct befor
This Is the 3 function
lic.DefineProduct(1, "test", 1, 1, "TestDemo", "{24EAA3C1-3DD7-40E0-AEA3-D20AA17A6005}");
lic.IsLicenseKeyValid(urlweb,key, out errorMsg);
int nStatus = (int)lic.GetStatus();
nstatus is still 8
I copy the the fuction ValidateLicense from QlmExpressApiSample
-
thanks John
maybe i didn't explaine myself well
the problem is :
when i create i trial key on the server ( portal ) with expire date
i find the dayleft ok -
but if i renew the expire day- the local machine doesn't know i change it
there is a way to check the dayleft online ?
using api get i get a key status ?
thank u very much :)
Noam
Please sign in to leave a comment.
Comments
6 comments