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.

適用於