IReflect.GetFields(BindingFlags) 方法

定義

傳回 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

繫結屬性,用來控制搜尋。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.

適用於

另請參閱