TypeBuilder.GetMember(String, MemberTypes, BindingFlags) 方法

定義

依指定傳回此類型所宣告或繼承的所有公用和非公用成員。Returns all the public and non-public members declared or inherited by this type, as specified.

public:
 override cli::array <System::Reflection::MemberInfo ^> ^ GetMember(System::String ^ name, System::Reflection::MemberTypes type, System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.MemberInfo[] GetMember (string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr);
override this.GetMember : string * System.Reflection.MemberTypes * System.Reflection.BindingFlags -> System.Reflection.MemberInfo[]
Public Overrides Function GetMember (name As String, type As MemberTypes, bindingAttr As BindingFlags) As MemberInfo()

參數

name
String

成員的名稱。The name of the member.

type
MemberTypes

要傳回的成員類型。The type of the member to return.

bindingAttr
BindingFlags

這必須是來自 BindingFlags 的位元旗標,像是在 InvokeMethodNonPublic 等等一樣。This must be a bit flag from BindingFlags, as in InvokeMethod, NonPublic, and so on.

傳回

MemberInfo[]

傳回 MemberInfo 物件的陣列,如果使用了 nonPublic,則會代表這個類型上定義的公用和非公用成員 ;否則只會傳回公用成員。Returns an array of MemberInfo objects representing the public and non-public members defined on this type if nonPublic is used; otherwise, only the public members are returned.

例外狀況

不會為不完整的類型實作此方法。This method is not implemented for incomplete types.

備註

使用或抓取型 Type.GetTypeAssembly.GetType ,然後在抓取的型別上使用反映。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

適用於