IReflect.GetFields(BindingFlags) IReflect.GetFields(BindingFlags) IReflect.GetFields(BindingFlags) IReflect.GetFields(BindingFlags) Method

定义

返回与当前类的所有字段对应的 FieldInfo 对象的数组。Returns an array of FieldInfo objects that correspond to all fields of the current class.

public:
 cli::array <System::Reflection::FieldInfo ^> ^ GetFields(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.FieldInfo[] GetFields (System.Reflection.BindingFlags bindingAttr);
abstract member GetFields : System.Reflection.BindingFlags -> System.Reflection.FieldInfo[]
Public Function GetFields (bindingAttr As BindingFlags) As FieldInfo()

参数

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.

返回

FieldInfo 对象的数组,包含此反射对象的符合 bindingAttr 中指定的搜索约束的所有字段信息。An array of FieldInfo objects containing all the field information for this reflection object that meets the search constraints specified in bindingAttr.

注解

匹配基于名称。The match is based upon a name. 每个字段都必须具有唯一的名称。Each field must have a unique name. BindingFlags.NonPublic标志指定在搜索中包括非公共方法。The BindingFlags.NonPublic flag specifies that non-public methods are included in the search. BindingFlags.Public标志指定在搜索中包含公共方法。The BindingFlags.Public flag specifies that public methods are included in the search.

适用于

另请参阅