_Type.GetMember 方法

定義

為 COM 物件提供與版本無關的 GetMember 方法之存取權。Provides COM objects with version-independent access to the GetMember method.

多載

GetMember(String)

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

GetMember(String, BindingFlags)

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

GetMember(String, MemberTypes, BindingFlags)

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

備註

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

Type.GetMember方法會取得目前的指定成員 TypeThe Type.GetMember method gets the specified members of the current Type.

GetMember(String)

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

public:
 cli::array <System::Reflection::MemberInfo ^> ^ GetMember(System::String ^ name);
public System.Reflection.MemberInfo[] GetMember (string name);
abstract member GetMember : string -> System.Reflection.MemberInfo[]
Public Function GetMember (name As String) As MemberInfo()

參數

name
String

String,包含要取得的公用成員名稱。The String containing the name of the public members to get.

傳回

MemberInfo[]

MemberInfo 物件的陣列,代表具有指定名稱的公用成員 (如有找到);否則為空陣列。An array of MemberInfo objects representing the public members with the specified name, if found; otherwise, an empty array.

備註

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

Type.GetMember方法會搜尋具有指定名稱的公用成員。The Type.GetMember method searches for the public members with the specified name.

適用於

GetMember(String, BindingFlags)

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

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

參數

name
String

String,包含要取得的成員名稱。The String containing the name of the members to get.

bindingAttr
BindingFlags

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

-或--or- 零,表示傳回空陣列。Zero, to return an empty array.

傳回

MemberInfo[]

MemberInfo 物件的陣列,代表具有指定名稱的公用成員 (如有找到);否則為空陣列。An array of MemberInfo objects representing the public members with the specified name, if found; otherwise, an empty array.

備註

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

方法會使用指定的系結 Type.GetMember 條件約束,搜尋指定的成員。The Type.GetMember method searches for the specified members, using the specified binding constraints.

適用於

GetMember(String, MemberTypes, BindingFlags)

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

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

參數

name
String

String,包含要取得的成員名稱。The String containing the name of the members to get.

type
MemberTypes

要進行搜尋的 MemberTypes 值。The MemberTypes value to search for.

bindingAttr
BindingFlags

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

-或--or- 零,表示傳回空陣列。Zero, to return an empty array.

傳回

MemberInfo[]

MemberInfo 物件的陣列,代表具有指定名稱的公用成員 (如有找到);否則為空陣列。An array of MemberInfo objects representing the public members with the specified name, if found; otherwise, an empty array.

備註

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

方法會使用指定的系結 Type.GetMember 條件約束,搜尋指定成員類型的指定成員。The Type.GetMember method searches for the specified members of the specified member type, using the specified binding constraints.

適用於