_Type.GetInterface 方法

定义

为 COM 对象提供与版本无关的访问 GetInterface 方法。

重载

名称 说明
GetInterface(String)

为 COM 对象提供与版本无关的访问 GetInterface(String) 方法。

GetInterface(String, Boolean)

为 COM 对象提供与版本无关的访问 GetInterface(String, Boolean) 方法。

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

该方法 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包含要获取的接口的名称。 对于泛型接口,这是管理的名称。

返回

一个 Type 对象,表示具有指定名称的接口,如果找到,则由当前 Type实现或继承;否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

该方法 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包含要获取的接口的名称。 对于泛型接口,这是管理的名称。

ignoreCase
Boolean

true ,用于执行不区分大小写的 name搜索。

-或-

false ,用于执行区分大小写的 name搜索。

返回

一个 Type 对象,表示具有指定名称的接口,如果找到,则由当前 Type实现或继承;否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

该方法 Type.GetInterface 搜索指定的接口,指定是否执行区分大小写的搜索。

适用于