Note, you find more detailed examples of .NET here and C++ specific examples here. Please don’t hesitate to contact us should you have any questions.

License Key Registration

Dimtoken="WyIxNzIiLCJhak9OT1g3NW90YlQyRFFVUzBWdnlGSHJYdUpMdDA0REMxNzNOa2duIl0="Dimkey=TextBox1.Text.Replace(" ","")Dimlicense=NewLicenseKey()With{.ProductId=3349,.Key=key}Iflicense.Refresh(token,True)Then' we are able to auto complete missing key infoForm1.Button1.Enabled=license.HasFeature(3).IsValid()' either we have feature1 or not.Form1.Button2.Enabled=license.HasFeature(4).IsValid()' either we have feature2 or not.Form1.Button4.Enabled=license.HasFeature(5).IsValid()' either we have feature3 or not.Form1.Text="Digital Tools"Iflicense.HasFeature(1).HasNotExpired().IsValid()Then' feature 1 is a time limited, so we check that it has not expired.Form1.Text="Digital Tools - "+license.DaysLeft().ToString()+" day(s) left"ElseIflicense.HasNotFeature(1).IsValid()ThenElseMsgBox("Your license has expired and cannot be used.")nolicense()EndIflicense.SaveToFile()Else' something went wrong.MsgBox("Unable to access the license server or the key is wrong.")EndIf

This code will retrieve all the license data (using Refresh) and enable buttons depending on the features in the license.
Features 3-5 indicate a certain functionality whereas Feature 1 is used to indicate a time-limit (in case it’s a subscription).
Once we have a valid license, we will save it locally (it will be signed by SKM, because sign is set to true in Refresh).

Application Start

NoLicense()Dimlicense=NewLicenseKey().LoadFromFile()DimpublicKey="<RSAKeyValue><Modulus>sGbvxwdlDbqFXOMlVUnAF5ew0t0WpPW7rFpI5jHQOFkht/326dvh7t74RYeMpjy357NljouhpTLA3a6idnn4j6c3jmPWBkjZndGsPL4Bqm+fwE48nKpGPjkj4q/yzT4tHXBTyvaBjA8bVoCTn+LiC4XEaLZRThGzIn5KQXKCigg6tQRy0GXE13XYFVz/x1mjFbT9/7dS8p85n8BuwlY5JvuBIQkKhuCNFfrUxBWyu87CFnXWjIupCD2VO/GbxaCvzrRjLZjAngLCMtZbYBALksqGPgTUN7ZM24XbPWyLtKPaXF2i4XRR9u6eTj5BfnLbKAU5PIVfjIS+vNYYogteQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"Dimtoken="WyIxNzIiLCJhak9OT1g3NW90YlQyRFFVUzBWdnlGSHJYdUpMdDA0REMxNzNOa2duIl0="IflicenseIsNotNothingThen' either we get a fresh copy of the license or we use the existing one (given it is no more than 90 days old)Iflicense.Refresh(token,True)Orlicense.HasValidSignature(publicKey,90).IsValid()ThenButton1.Enabled=license.HasFeature(3).IsValid()' either we have feature1 or not.Button2.Enabled=license.HasFeature(4).IsValid()' either we have feature2 or not.Button4.Enabled=license.HasFeature(5).IsValid()' either we have feature3 or not.Text="Digital Tools"Iflicense.HasFeature(1).HasNotExpired().IsValid()Then' feature 1 is a time limited, so we check that it has not expired.Text="Digital Tools - "+license.DaysLeft().ToString()+" day(s) left"ElseIflicense.HasNotFeature(1).IsValid()Then' not time limited.ElseMsgBox("Your license has expired and cannot be used.")NoLicense()EndIflicense.SaveToFile()ElseMsgBox("Your license has expired and cannot be used.")EndIfElse' no license found. you could tell the user to provide a license key.EndIf

When your application launches, we will try to get a new version of the license key, in case it has been modified.
If we don’t have internet access, we will use the local copy as long as 90 days have not passed since it was retrieved.
Everything else is the same as when the user registers the license for the first time.