Beruflich Dokumente
Kultur Dokumente
NET Framework provides a licensing model that is identical for all components
and controls, including Windows Forms controls and ASP.NET server controls, and is
fully compatible with licensing for Microsoft ActiveX® controls.
With licensing, you, as the component or control author, can help protect your
intellectual property by verifying that a developer is authorized to use your
component or control. This verification is more important at design time, when a
developer incorporates your component or control into an application, than at run
time. When a developer legally uses your licensed component or control at design
time, the developer's application gets a run-time license that the developer can
freely distribute.
You have many other levels of licensing support with the licensing model. The model
separates the validation logic from the component or control. A license provider
grants licenses and performs the validation logic. The provider is a class that derives
fromSystem.ComponentModel.LicenseProvider. The steps that you must take to
enable licensing are straightforward.
• The name of the file must be the fully qualified name, including the
namespace, of the class with the file name extension .LIC. For example:
Namespace1.Class1.LIC
• The content of the license file should contain the following text string:
The following code examples show a Windows Forms control and an ASP.NET server
control that implement a simple case of licensing.
public MyControl ()
{
using System;
using System.ComponentModel;
using System.Web.UI;
public MyServerControl()
{
// Adds Validate to the control's constructor.
license = LicenseManager.Validate(typeof(MyServerControl), this);
base.Dispose();
}
}