_Type.GetFields _Type.GetFields _Type.GetFields _Type.GetFields Method

定義

為 COM 物件提供與版本無關的 GetFields 方法之存取權。Provides COM objects with version-independent access to the GetFields method.

多載

GetFields(BindingFlags) GetFields(BindingFlags) GetFields(BindingFlags) GetFields(BindingFlags)

為 COM 物件提供與版本無關的 GetFields(BindingFlags) 方法之存取權。Provides COM objects with version-independent access to the GetFields(BindingFlags) method.

GetFields() GetFields() GetFields() GetFields()

為 COM 物件提供與版本無關的 GetFields() 方法之存取權。Provides COM objects with version-independent access to the GetFields() method.

備註

這個方法會從 unmanaged 程式碼,是用於存取 managed 類別,並不會呼叫從 managed 程式碼。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetFields方法會取得目前的特定欄位TypeThe Type.GetFields method gets a specific field of the current Type.

GetFields(BindingFlags) GetFields(BindingFlags) GetFields(BindingFlags) GetFields(BindingFlags)

為 COM 物件提供與版本無關的 GetFields(BindingFlags) 方法之存取權。Provides COM objects with version-independent access to the GetFields(BindingFlags) method.

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

位元遮罩,由一或多個 BindingFlags 組成,而這些旗標會指定執行搜尋的方式。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-或--or- 零,傳回 nullZero, to return null.

傳回

FieldInfo 物件的陣列,代表為目前 Type 定義之符合指定繫結條件約束的所有欄位。An array of FieldInfo objects representing all fields defined for the current Type that match the specified binding constraints.

-或--or- 如果沒有任何欄位定義給目前 FieldInfo 的欄位,或沒有已定義的欄位符合繫結條件約束,則為 Type 類型的空陣列。An empty array of type FieldInfo, if no fields are defined for the current Type, or if none of the defined fields match the binding constraints.

備註

這個方法會從 unmanaged 程式碼,是用於存取 managed 類別,並不會呼叫從 managed 程式碼。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetFields方法會搜尋定義給目前的欄位Type,使用指定的繫結條件約束。The Type.GetFields method searches for the fields defined for the current Type, using the specified binding constraints.

GetFields() GetFields() GetFields() GetFields()

為 COM 物件提供與版本無關的 GetFields() 方法之存取權。Provides COM objects with version-independent access to the GetFields() method.

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

傳回

FieldInfo 物件的陣列,代表為目前 Type 定義的所有公用欄位。An array of FieldInfo objects representing all the public fields defined for the current Type.

-或--or- FieldInfo 類型的空陣列 (如果沒有為目前 Type 定義公用欄位)。An empty array of type FieldInfo, if no public fields are defined for the current Type.

備註

這個方法會從 unmanaged 程式碼,是用於存取 managed 類別,並不會呼叫從 managed 程式碼。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetFields方法會傳回在目前的所有公用欄位TypeThe Type.GetFields method returns all the public fields of the current Type.

適用於