TypeBuilder.GetMembers(BindingFlags) 方法

定義

傳回這個類型所宣告或繼承的公用和非公用成員之成員。Returns the members for the public and non-public members declared or inherited by this type.

public:
 override cli::array <System::Reflection::MemberInfo ^> ^ GetMembers(System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.MemberInfo[] GetMembers (System.Reflection.BindingFlags bindingAttr);
override this.GetMembers : System.Reflection.BindingFlags -> System.Reflection.MemberInfo[]
Public Overrides Function GetMembers (bindingAttr As BindingFlags) As MemberInfo()

參數

bindingAttr
BindingFlags

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

傳回

MemberInfo[]

傳回 MemberInfo 物件的陣列,代表這個類型所宣告或繼承的公用和非公用成員。Returns an array of MemberInfo objects representing the public and non-public members declared or inherited by this type. 如果沒有任何成員符合,則會傳回空陣列。An empty array is returned if there are no matching members.

例外狀況

不會為不完整的類型實作此方法。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.

適用於