You can generate license with LibraryToolbox.exe without need to write program. This example is usable for automated systems or customized works.

  1. public void GenerateLicenseForCustomer(string ProductName, string LicenseOwner, string HardwareID = "", System.DateTime LicenseExpiration = null)
  2. {
  3.     TreeksLicensingLibrary.License lic = new TreeksLicensingLibrary.License();
  4.     TreeksLicensingLibrary.LicenseSigningKey key = new TreeksLicensingLibrary.LicenseSigningKey();
  5.  
  6.     key.LoadFile("C:\\myappkey.lkey");
  7.  
  8.     lic.ProductName = ProductName;
  9.     lic.OwnerName = LicenseOwner;
  10.     lic.HardwareID = HardwareID;
  11.     lic.ExpirationDate = LicenseExpiration;
  12.  
  13.     string strLicense = lic.GeneratedSignedLicenseXML(key);
  14.  
  15.     IO.File.WriteAllText("C:\\registration.lic", strLicense, false);
  16. }
  1. Public Sub GenerateLicenseForCustomer(ByVal ProductName As String, ByVal LicenseOwner As String, Optional ByVal HardwareID As String = "", Optional ByVal LicenseExpiration As Date = Nothing)
  2.         Dim lic As New TreeksLicensingLibrary.License
  3.         Dim key As New TreeksLicensingLibrary.LicenseSigningKey
  4.  
  5.         key.LoadFile("C:\myappkey.lkey")
  6.  
  7.         lic.ProductName = ProductName
  8.         lic.OwnerName = LicenseOwner
  9.         lic.HardwareID = HardwareID
  10.         lic.ExpirationDate = LicenseExpiration
  11.  
  12.         Dim strLicense As String = lic.GeneratedSignedLicenseXML(key)
  13.  
  14.         My.Computer.FileSystem.WriteAllText("C:\registration.lic", strLicense, False)
  15.     End Sub