TypedArray.GetField(String, BindingFlags) 方法

定义

获取具有指定名称的 Array 类类型的字段。Gets a field of the Array class type that has the specified name.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 virtual System::Reflection::FieldInfo ^ GetField(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.FieldInfo GetField (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfo
override this.GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfo
Public Function GetField (name As String, bindingAttr As BindingFlags) As FieldInfo

参数

name
String

要获取的字段的名称。The name of the field to get.

bindingAttr
BindingFlags

枚举值的按位组合,用于指定反射如何执行成员搜索。A bitwise combination of the enumeration values that specifies how the search for members is conducted by reflection.

返回

FieldInfo

一个具有指定名称的字段(如果找到一个这样的字段);否则为 null。A field that has the specified name, if one is found; otherwise, null.

实现

适用于

另请参阅