Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Populate the License Management database with user data fields when generating licenses using the API

 
Subscribe to the RSS feed for this forum  Forum Index -> CryptoLicensing For ActiveX
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Mon Oct 31, 2011 5:26 am    Post subject: HOWTO: Populate the License Management database with user data fields when generating licenses using the API

When using the Generator API to generate licenses, use the following code before calling the Generate method:
[C#]
Code:
// Get the "Data Fields" plugin
PropertiesPlugin plg = gen.GetUserDataPluginFromName("Data Fields") as PropertiesPlugin;

// Set it as the user-data plugin which the generator will use to retrieve the user-data to embed in the generated license
gen.SetUserDataPlugin(plg);

// populate the fields of the "Data Fields" plugin
plg.GetPropertyByName("Name").Value ="xyz";
plg.GetPropertyByName("Email").Value ="xyz";
plg.GetPropertyByName("Company").Value ="xyz";

// Alternately you can also do the following to set all fields at once...
// plg.SetUserData("first name=xxx;last name=yyy");

// Generate the license...
gen.Generate();


[VB.Net]
Code:
' Get the "Data Fields" plugin
Dim plg As PropertiesPlugin = TryCast(gen.GetUserDataPluginFromName("Data Fields"), PropertiesPlugin)

' Set it as the user-data plugin which the generator will use to retrieve the user-data to embed in the generated license
gen.SetUserDataPlugin(plg)

' populate the fields of the "Data Fields" plugin
plg.GetPropertyByName("Name").Value = "xyz"
plg.GetPropertyByName("Email").Value = "xyz"
plg.GetPropertyByName("Company").Value = "xyz"

' Alternately you can also do the following to set all fields at once...
' plg.SetUserData("first name=xxx;last name=yyy");

' Generate the license...
gen.Generate()
Back to top
Display posts from previous:   
Forum Index -> CryptoLicensing For ActiveX All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group