License Object Usage Example For Microsoft Visual C# .NET 2003
To use C#:
Add a License object to your project (e.g. license1). The object appears in the iNTERFACEWARE section of your toolbox.
C# Workspace, Showing the License Inside the Toolbox
Use the following code (or something similar) to use the object:
try
{
//Print true if machine is registered.
Println( "Machine is registered: " + license1.IsLicensed );
//Fetch the machine id.
String MachineId = license1.MachineId;
Println( "The machine id is : " + MachineId);
//Set a proxy if required.
//LicenseObj.Proxy = "webproxy.acme.com";
//Fetch the registration code.
String RegistrationCode = license1.FetchRegistrationCode(MachineId,
"your.name@yourcompany.com",
"password01",
"My Development Code");
//Register this machine with this code.
license1.RegisterHost(RegistrationCode);
}
catch( ChameleonException ce )
{
Println( ce.Message );
}
// ...