TypeInfo.GetDeclaredField(String) 方法

定义

返回表示由当前类型声明的指定公共字段的对象。Returns an object that represents the specified public field declared by the current type.

public:
 virtual System::Reflection::FieldInfo ^ GetDeclaredField(System::String ^ name);
public virtual System.Reflection.FieldInfo GetDeclaredField (string name);
abstract member GetDeclaredField : string -> System.Reflection.FieldInfo
override this.GetDeclaredField : string -> System.Reflection.FieldInfo
Public Overridable Function GetDeclaredField (name As String) As FieldInfo

参数

name
String

字段的名称。The name of the field.

返回

如果找到对象,则为表示指定的字段的对象;否则为 nullAn object that represents the specified field, if found; otherwise, null.

异常

namenullname is null.

适用于