_Type.FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) 方法


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

 cli::array <System::Reflection::MemberInfo ^> ^ FindMembers(System::Reflection::MemberTypes memberType, System::Reflection::BindingFlags bindingAttr, System::Reflection::MemberFilter ^ filter, System::Object ^ filterCriteria);
public System.Reflection.MemberInfo[] FindMembers (System.Reflection.MemberTypes memberType, System.Reflection.BindingFlags bindingAttr, System.Reflection.MemberFilter filter, object filterCriteria);
abstract member FindMembers : System.Reflection.MemberTypes * System.Reflection.BindingFlags * System.Reflection.MemberFilter * obj -> System.Reflection.MemberInfo[]
Public Function FindMembers (memberType As MemberTypes, bindingAttr As BindingFlags, filter As MemberFilter, filterCriteria As Object) As MemberInfo()



MemberTypes 物件,表示要搜尋的成員類型。A MemberTypes object indicating the type of member to search for.


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

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


執行比較的委派,如果目前進行檢查的成員符合 true,則傳回 filterCriteria,否則傳回 falseThe delegate that does the comparisons, returning true if the member currently being inspected matches the filterCriteria and false otherwise. 您可以使用這個類別所提供的 FilterAttributeFilterNameFilterNameIgnoreCase 委派。You can use the FilterAttribute, FilterName, and FilterNameIgnoreCase delegates supplied by this class. 第一個委派使用 FieldAttributesMethodAttributesMethodImplAttributes 的欄位做為搜尋準則,而其他兩個委派則使用 String 物件做為搜尋準則。The first uses the fields of FieldAttributes, MethodAttributes, and MethodImplAttributes as search criteria, and the other two delegates use String objects as the search criteria.


判斷在 MemberInfo 物件的陣列中是否傳回成員的搜尋準則。The search criteria that determines whether a member is returned in the array of MemberInfo objects.

FieldAttributesMethodAttributesMethodImplAttributes 的欄位可以與這個類別所提供的 FilterAttribute 委派結合使用。The fields of FieldAttributes, MethodAttributes, and MethodImplAttributes can be used in conjunction with the FilterAttribute delegate supplied by this class.


指定之成員類型的 MemberInfo 物件篩選陣列。A filtered array of MemberInfo objects of the specified member type.

-或--or- MemberInfo 類型的空陣列,如果目前 Type 沒有符合篩選條件的 memberType 類型的成員。An empty array of type MemberInfo, if the current Type does not have members of type memberType that match the filter criteria.


這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

方法會傳回指定成員類型之MemberInfo物件的篩選陣列。 Type.FindMembersThe Type.FindMembers method returns a filtered array of MemberInfo objects of the specified member type.