_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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。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.

适用于