LicenseContext 类

指定何时可使用授权的对象,并且提供一种方法,用以获取为支持在其域内运行的许可证所需要的附加服务。

**命名空间:**System.ComponentModel
**程序集:**System(在 system.dll 中)

语法

声明
Public Class LicenseContext
    Implements IServiceProvider
用法
Dim instance As LicenseContext
public class LicenseContext : IServiceProvider
public ref class LicenseContext : IServiceProvider
public class LicenseContext implements IServiceProvider
public class LicenseContext implements IServiceProvider

备注

该类提供默认的 LicenseContext。它仅实现运行时支持,不支持已保存的许可证密钥。

提示

应用于此类的 HostProtectionAttribute 属性 (Attribute) 具有以下 Resources 属性 (Property) 值:SharedStateHostProtectionAttribute 不影响桌面应用程序(这些应用程序通常通过双击图标、键入命令或在浏览器中输入 URL 来启动)。有关更多信息,请参见 HostProtectionAttribute 类或 SQL Server 编程和宿主保护属性

给继承者的说明 如果要实现设计时许可证支持,您必须从该类继承,并且重写以下成员:UsageModeGetSavedLicenseKeyGetServiceSetSavedLicenseKey。如果要实现保存的许可证密钥,则请重写 GetSavedLicenseKeySetSavedLicenseKey 方法。 有关授权的更多信息,请参见 如何:授予组件和控件许可权限

继承层次结构

System.Object
  System.ComponentModel.LicenseContext
     System.ComponentModel.Design.DesigntimeLicenseContext

线程安全

此类型的任何公共静态(Visual Basic 中的 Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

LicenseContext 成员
System.ComponentModel 命名空间
License 类
LicenseException
LicenseManager
LicenseProvider
LicenseProviderAttribute
LicFileLicenseProvider
LicenseUsageMode