GetExpiryDate ? how to get the expiry date c#

Comments

6 comments

  • Official comment
    Avatar
    Soraco Technologies

    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 Permalink
  • Avatar
    noam

    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 ? 

     

    0
    Comment actions Permalink
  • Avatar
    Soraco Technologies

    Hi Noam

     

    1. Are you calling DefineProduct before calling ValidateLicenseEx?

    2. Are you using the LicenseValidator class?

     

    Regards

    John

    0
    Comment actions Permalink
  • Avatar
    noam

    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

     

     

    0
    Comment actions Permalink
  • Avatar
    Soraco Technologies

    Hi Noam

    The proper sequence is:

    -DefineProduct

    -ValidateLicenseEx

    - GetStatus

    - IsLicenseKeyValid

     

    Regards

    John

     

    0
    Comment actions Permalink
  • Avatar
    noam

    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  

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.