March 2003
Intermediate to advanced
896 pages
32h 35m
English
LicFileLicenseProvider
In this implementation of LicenseProvider, the
GetLicense() member looks for a file called
ClassName.LIC in the same directory as the
.dll containing the component. It then uses the
IsKeyValid() method to see if the file contains
the key string provided by the GetKey() method.
By default, the string is: “ClassName is a licensed
component.” You could derive a class that overrides
one or both of these methods to provide a more complex
.LIC file licensing scheme.
public class LicFileLicenseProvider : LicenseProvider { // Public Constructors public LicFileLicenseProvider(); // Public Instance Methods public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions); // overrides LicenseProvider // Protected Instance Methods protected virtual string GetKey(Type type); protected virtual bool IsKeyValid(string key, Type type); }
System.Object
→ LicenseProvider → LicFileLicenseProvider
Read now
Unlock full access