Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Sat Feb 19, 2011 6:01 am Post subject: HOWTO: Set license features when generating new licenses using the Generator API |
|
|
Use the following code to set license features when generating new licenses using the Generator API:
[C#]
Code: | CryptoLicenseGenerator gen = new CryptoLicenseGenerator(@"c:\MyApp.netlicproj"); // Load license project
BitArray ba = new BitArray(3); // 3-bit array
ba[0]=true; // Feature 1 present
ba[1]=false;// Feature 2 not present
ba[2]=true;// Feature 3 present
gen.SetFeaturesEx(ba);
gen.Generate(); // The generated license will have the above specified features |
[VB.Net]
Code: | Dim gen As CryptoLicenseGenerator = New CryptoLicenseGenerator("c:\MyApp.netlicproj") ' Load license project
Dim ba As BitArray = New BitArray(3) ' 3-bit array
ba(0) = True ' Feature 1 present
ba(1) = False ' Feature 2 not present
ba(2) = True ' Feature 3 present
gen.SetFeaturesEx(ba)
gen.Generate() ' The generated license will have the above specified features Each license can have upto 2040 bits/features. |
|
|