AccessibleObject.IReflect.GetField(String, BindingFlags) 方法

定義

取得對應到指定欄位和繫結旗標的 FieldInfo 物件。Gets the FieldInfo object corresponding to the specified field and binding flag. 如需這個成員的說明,請參閱 GetField(String, BindingFlags)For a description of this member, see GetField(String, BindingFlags).

 virtual System::Reflection::FieldInfo ^ System.Reflection.IReflect.GetField(System::String ^ name, System::Reflection::BindingFlags bindingAttr) = System::Reflection::IReflect::GetField;
System.Reflection.FieldInfo IReflect.GetField (string name, System.Reflection.BindingFlags bindingAttr);
Function GetField (name As String, bindingAttr As BindingFlags) As FieldInfo Implements IReflect.GetField

參數

name
String

要尋找的欄位名稱。The name of the field to find.

bindingAttr
BindingFlags

繫結屬性,用來控制搜尋。The binding attributes used to control the search.

傳回

FieldInfo 物件,包含符合 bindingAttr 中所指定搜尋條件約束 (Constraint) 的具名物件欄位資訊。A FieldInfo object containing the field information for the named object that meets the search constraints specified in bindingAttr.

實作

例外狀況

物件會使用相同名稱,實作多重欄位。The object implements multiple fields with the same name.

備註

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 AccessibleObject 執行個體轉換成 IReflect 介面時,才能使用這個成員。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

適用於