Share via


LicFileLicenseProvider.IsKeyValid(String, Type) 方法

定義

判斷 GetLicense(LicenseContext, Type, Object, Boolean) 方法所擷取的索引鍵對指定型別是否有效。

protected:
 virtual bool IsKeyValid(System::String ^ key, Type ^ type);
protected virtual bool IsKeyValid (string key, Type type);
protected virtual bool IsKeyValid (string? key, Type type);
abstract member IsKeyValid : string * Type -> bool
override this.IsKeyValid : string * Type -> bool
Protected Overridable Function IsKeyValid (key As String, type As Type) As Boolean

參數

key
String

要進行檢查的 LicenseKey

type
Type

Type,表示要求 License 的元件。

傳回

如果 LicenseKey 是指定型別的有效索引鍵,則為 true,否則為 false

備註

這個方法會根據片語檢查機碼:「 myClassName is a licensed component. ,其中 myClassNameFullName 您要建立之元件的 。

給繼承者的注意事項

當您繼承自這個類別時,您可以覆寫這個方法以提供您自己的驗證邏輯。

適用於

另請參閱