_Type.GetInterface 方法

定義

為 COM 物件提供與版本無關的 GetInterface 方法之存取權。

多載

GetInterface(String)

為 COM 物件提供與版本無關的 GetInterface(String) 方法之存取權。

GetInterface(String, Boolean)

為 COM 物件提供與版本無關的 GetInterface(String, Boolean) 方法之存取權。

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 Type.GetInterface 會取得目前 Type 實作或繼承的特定介面。

GetInterface(String)

為 COM 物件提供與版本無關的 GetInterface(String) 方法之存取權。

public:
 Type ^ GetInterface(System::String ^ name);
public Type GetInterface (string name);
abstract member GetInterface : string -> Type
Public Function GetInterface (name As String) As Type

參數

name
String

String,包含要取得的介面名稱。 若為泛型介面,則為 mangled 名稱。

傳回

Type 物件,表示具有指定之名稱的介面是由目前 Type 所實作或繼承的 (如有找到);否則為 null

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法會 Type.GetInterface 搜尋具有指定名稱的介面。

適用於

GetInterface(String, Boolean)

為 COM 物件提供與版本無關的 GetInterface(String, Boolean) 方法之存取權。

public:
 Type ^ GetInterface(System::String ^ name, bool ignoreCase);
public Type GetInterface (string name, bool ignoreCase);
abstract member GetInterface : string * bool -> Type
Public Function GetInterface (name As String, ignoreCase As Boolean) As Type

參數

name
String

String,包含要取得的介面名稱。 若為泛型介面,則為 mangled 名稱。

ignoreCase
Boolean

name 執行不區分大小寫的搜尋,則為 true

-或-

name 執行區分大小寫的搜尋,則為 false

傳回

Type 物件,表示具有指定之名稱的介面是由目前 Type 所實作或繼承的 (如有找到);否則為 null

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法會 Type.GetInterface 搜尋指定的介面,指定是否要執行區分大小寫的搜尋。

適用於