次の方法で共有


LicFileLicenseProvider.GetLicense メソッド

コンポーネントのインスタンスに与えられるライセンスがある場合は、そのライセンスを返します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)

構文

'宣言
Public Overrides Function GetLicense ( _
    context As LicenseContext, _
    type As Type, _
    instance As Object, _
    allowExceptions As Boolean _
) As License
'使用
Dim instance As LicFileLicenseProvider
Dim context As LicenseContext
Dim type As Type
Dim instance As Object
Dim allowExceptions As Boolean
Dim returnValue As License

returnValue = instance.GetLicense(context, type, instance, allowExceptions)
public override License GetLicense (
    LicenseContext context,
    Type type,
    Object instance,
    bool allowExceptions
)
public:
virtual License^ GetLicense (
    LicenseContext^ context, 
    Type^ type, 
    Object^ instance, 
    bool allowExceptions
) override
public License GetLicense (
    LicenseContext context, 
    Type type, 
    Object instance, 
    boolean allowExceptions
)
public override function GetLicense (
    context : LicenseContext, 
    type : Type, 
    instance : Object, 
    allowExceptions : boolean
) : License

パラメータ

  • context
    ライセンス付きのオブジェクトを使用できる位置を指定する LicenseContext
  • type
    License を要求しているコンポーネントを表す Type
  • instance
    License を要求するオブジェクト。
  • allowExceptions
    コンポーネントにライセンスが与えられなかったときに LicenseException をスローする必要がある場合は true。それ以外の場合は false

戻り値

有効な License。このメソッドは、有効な License または context パラメータが見つからなかった場合は null 参照 (Visual Basic では Nothing) を返します。

解説

デザイン時には、GetLicense メソッドは myClassName.LIC という名前のライセンス ファイルを検索します。ここで myClassName は作成するコンポーネントの FullName です。このファイルは、コンポーネントが格納されている .dll ファイルと同じディレクトリ内に存在する必要があります。

次に、このメソッドは、ライセンス ファイルの最初の行を IsKeyValid メソッドで指定されたキーと照合します。キーが有効な場合、この行は LicenseKey として使用されます。

プラットフォーム

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

参照

関連項目

LicFileLicenseProvider クラス
LicFileLicenseProvider メンバ
System.ComponentModel 名前空間
License クラス
LicenseContext クラス
LicenseException クラス
LicenseManager クラス
LicenseProvider クラス
LicenseProviderAttribute クラス
LicFileLicenseProvider クラス
LicenseUsageMode 列挙体