Extendable limits - like the Time and Use limits - make it easy to update licenses on a client machine without issuing new licenses. For example, issuing codes that allow users to extend the use of their trial version. Extendable limits are also effective in creating product subscriptions where the user must periodically pay for continued use of the software.
Extendable limits may be extended with a code that the user enters on their machine. Codes can be generated from the DeployLX Manager or in code.
Once an extension code generated with a given serial number and limit code, it may notbe used again. The extension code will only work if the limit code used to generate the extension matches the limit code displayed on the extension form so if the user attempts to reformat and enter an old extension code it will fail.
This sample demonstrates how to generate an extension code in code. See the MakeLicenseExtension method for details.
Private key As New LicenseKey("Path to LSK keys file") key.DeployLxSerialNumbers = New String() { "Your DeployLX Serial Number." } Private serialNumber As String = key.MakeLicenseExtension(_ "PRO-",_ "18231BC2-1914-43C9-89D3-94E836B959A5",_ "PRO-XXXXX-XXXXX-XXXX-XXXX",_ 86400,_ DateTime.MinValue, _ Nothing, _ CodeAlgorithm.Advanced )
LicenseKey key = new LicenseKey( "Path to LSK keys file" ); key.DeployLxSerialNumbers = new string[] { "Your DeployLX Serial Number." }; string serialNumber = key.MakeLicenseExtension( "PRO-", "18231BC2-1914-43C9-89D3-94E836B959A5", "PRO-XXXXX-XXXXX-XXXX-XXXX", 86400, DateTime.MinValue, null, CodeAlgorithm.Advanced );
Automate extensions with a license server. To add support you modify the Extend method of the ASMX file to support your license extension rules.
See the License Servers in DeployLX topic for details on creating and deploying a license server.
This code sample demonstrates a basic implementation of the CanExtend and RecordExtension methods.
Protected Overrides Function Extend( _ ByVal context As ServerRequestContext, _ ByVal limit As IExtendableLimit) As Boolean If Not HasPaidForRenewal(limit.License.SerialNumber) Then Throw New Exception("You have not paid for your renewal.") End If Dim time = TryCast(limit, TimeLimit) time.AbsoluteDate = GetExpirationDate(limit.License.SerialNumber) NotifyModification(time) Return True End Function
protected override bool Extend( ServerRequestContext context, IExtendableLimit limit ) { if( ! HasPaidForRenewal( limit.License.SerialNumber ) ) throw new Exception( "You have not paid for your renewal." ); var time = limit as TimeLimit; time.AbsoluteDate = GetExpirationDate( limit.License.SerialNumber ); NotifyModification( time ); return true; }