_Type.GetFields Method

Definition

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

Overloads

GetFields(BindingFlags)

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

GetFields()

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

Remarks

這個方法是用來從非受控程式碼存取 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 gets a specific field of the current Type.

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()

Parameters

bindingAttr
BindingFlags

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

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

Returns

FieldInfo[]

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.

Remarks

這個方法是用來從非受控程式碼存取 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()

為 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()

Returns

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.

Remarks

這個方法是用來從非受控程式碼存取 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 returns all the public fields of the current Type.

Applies to