Control Licensing

  • Thread starter Thread starter Mauro
  • Start date Start date
M

Mauro

Help please!

I'm trying to implement control licensing using the LicFileLicenseProvider
implementation of the LicenseProvider class, but I cannot seem to get the
right format either in my <controlname>.LIC file, or in the first line
"myClass name is a licensed component" in the file. (I will implement my own
validation once I get the basic structure working.)

All I can find in the literature is a reference to using the fully qualified
name of the control, and the fully qualified name of the component.

My control is called ctlAlarmClock and it's contained in a component class
called ctlClockLib. So I would have thought that

filename = ctlClockLib.ctlAlarmClock.LIC

text = "ctlClockLib is a licensed component"

should both work.

Any help would be greatly appreciated.

Mauro
 
try is:

Filename: ctlClockLib.ctlAlarmClock.LIC
text: ctlClockLib.ctlAlarmClock is a licensed component

what attributes do you have on you class ?

[
System.ComponentModel.LicenseProvider(typeof(System.ComponentModel.LicFilePr
ovider)),
]
public class ctlAlarmClock : Control
{
private License lic;

//check license
lic = LicenseManger.Validate(typeof(ctlClockLib.ctlAlarmClock),this);
}

you will also need to dispose of the license

protected override void Dispose (bool disposing)
{
if ( lic !=null )
{
lic.dispose();
}
base.Dispose( disposing )
}


also checkout LicenseManger.validate

hope this helps

Dion Heskett
www.viascape.com
 
Back
Top