_Type.GetProperty _Type.GetProperty _Type.GetProperty _Type.GetProperty Method

定义

为 COM 对象提供对 GetProperty 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty method.

重载

GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, Type, Type[], ParameterModifier[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type, Type[], ParameterModifier[]) method.

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) method.

GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[])

为 COM 对象提供对 GetProperty(String, Type, Type[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type, Type[]) method.

GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type)

为 COM 对象提供对 GetProperty(String, Type) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type) method.

GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[])

为 COM 对象提供对 GetProperty(String, Type[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type[]) method.

GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags)

为 COM 对象提供对 GetProperty(String, BindingFlags) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, BindingFlags) method.

GetProperty(String) GetProperty(String) GetProperty(String) GetProperty(String)

为 COM 对象提供对 GetProperty(String) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String) method.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法获取当前的特定属性TypeThe Type.GetProperty method gets a specific property of the current Type.

GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, Type, Type[], ParameterModifier[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type, Type[], ParameterModifier[]) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

参数

name
String String String String

包含要获取的公共属性名的 StringThe String containing the name of the public property to get.

returnType
Type Type Type Type

属性的返回类型。The return type of the property.

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

- 或 --or- 获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

modifiers
ParameterModifier[]

ParameterModifier 对象的数组,表示与 types 数组中的相应元素关联的特性。An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. 默认的联编程序不处理此参数。The default binder does not process this parameter.

返回

表示符合指定要求的公共属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the public property that matches the specified requirements, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索其参数与指定的参数类型及修饰符匹配的指定公共属性。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types and modifiers.

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo

参数

name
String String String String

包含要获取的属性名的 StringThe String containing the name of the property to get.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or- 零,以返回 nullZero, to return null.

binder
Binder Binder Binder Binder

一个 Binder 对象,该对象定义一组属性并启用绑定,而绑定可能涉及选择重载方法、强制转换参数类型和通过反射调用成员。A Binder object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.

- 或 --or- 若为 null,则使用 DefaultBindernull, to use the DefaultBinder.

returnType
Type Type Type Type

属性的返回类型。The return type of the property.

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

-or- 获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

modifiers
ParameterModifier[]

ParameterModifier 对象的数组,表示与 types 数组中的相应元素关联的特性。An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. 默认的联编程序不处理此参数。The default binder does not process this parameter.

返回

表示符合指定要求的属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the property that matches the specified requirements, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索其参数与指定的参数类型及修饰符,使用指定的绑定约束匹配的指定属性。The Type.GetProperty method searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.

GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[])

为 COM 对象提供对 GetProperty(String, Type, Type[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type, Type[]) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types);
abstract member GetProperty : string * Type * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type()) As PropertyInfo

参数

name
String String String String

包含要获取的公共属性名的 StringThe String containing the name of the public property to get.

returnType
Type Type Type Type

属性的返回类型。The return type of the property.

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

- 或 --or- 获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

返回

表示其参数与指定参数类型匹配的公共属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the public property whose parameters match the specified argument types, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索其参数与指定的参数类型匹配的指定公共属性。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types.

GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type)

为 COM 对象提供对 GetProperty(String, Type) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType);
abstract member GetProperty : string * Type -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type) As PropertyInfo

参数

name
String String String String

包含要获取的公共属性名的 StringThe String containing the name of the public property to get.

returnType
Type Type Type Type

属性的返回类型。The return type of the property.

返回

表示具有指定名称的公共属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the public property with the specified name, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索具有指定的名称和返回类型的公共属性。The Type.GetProperty method searches for the public property with the specified name and return type.

GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[])

为 COM 对象提供对 GetProperty(String, Type[]) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, Type[]) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type[] types);
abstract member GetProperty : string * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, types As Type()) As PropertyInfo

参数

name
String String String String

包含要获取的公共属性名的 StringThe String containing the name of the public property to get.

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

- 或 --or- 获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

返回

表示其参数与指定参数类型匹配的公共属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the public property whose parameters match the specified argument types, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索其参数与指定的参数类型匹配的指定公共属性。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types.

GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags)

为 COM 对象提供对 GetProperty(String, BindingFlags) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String, BindingFlags) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags) As PropertyInfo

参数

name
String String String String

包含要获取的属性名的 StringThe String containing the name of the property to get.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or- 零,以返回 nullZero, to return null.

返回

表示符合指定要求的属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the property that matches the specified requirements, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索指定的属性,使用指定的绑定约束。The Type.GetProperty method searches for the specified property, using the specified binding constraints.

GetProperty(String) GetProperty(String) GetProperty(String) GetProperty(String)

为 COM 对象提供对 GetProperty(String) 方法的版本无关的访问。Provides COM objects with version-independent access to the GetProperty(String) method.

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name);
public System.Reflection.PropertyInfo GetProperty (string name);
abstract member GetProperty : string -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String) As PropertyInfo

参数

name
String String String String

包含要获取的公共属性名的 StringThe String containing the name of the public property to get.

返回

表示具有指定名称的公共属性的 PropertyInfo 对象(如果找到的话);否则为 nullA PropertyInfo object representing the public property with the specified name, if found; otherwise, null.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetProperty方法搜索具有指定名称的公共属性。The Type.GetProperty method searches for the public property with the specified name.

适用于