_Type.GetProperty _Type.GetProperty _Type.GetProperty _Type.GetProperty Method

定義

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

多載

GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[])

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

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

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

GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[])

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

GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type)

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

GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[])

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

GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags)

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

GetProperty(String) GetProperty(String) GetProperty(String) GetProperty(String)

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

備註

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

方法會取得目前Type的特定屬性。 Type.GetPropertyThe Type.GetProperty method gets a specific property of the current Type.

GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[]) GetProperty(String, Type, Type[], ParameterModifier[])

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

參數

name
String String String String

String,包含要取得的公用屬性名稱。The String containing the name of the public property to get.

returnType
Type Type Type Type

屬性的傳回型別。The return type of the property.

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

-或--or- 用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

modifiers
ParameterModifier[]

ParameterModifier 物件的陣列,代表在 types 陣列中與對應項目關聯的屬性。An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. 預設的繫結器不會處理這個參數。The default binder does not process this parameter.

傳回

PropertyInfo 物件,表示符合指定之需求的公用屬性 (如有找到);否則為 nullA PropertyInfo object representing the public property that matches the specified requirements, if found; otherwise, null.

備註

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

Type.GetProperty方法會搜尋指定的公用屬性,其參數符合指定的引數類型和修飾詞。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types and modifiers.

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo

參數

name
String String String String

String,包含要取得的屬性名稱。The String containing the name of the property to get.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

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

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

binder
Binder Binder Binder Binder

Binder 物件,定義一組屬性並啟用繫結,可包含多載方法的選擇、引數類型的強制型轉,以及透過反映的成員引動過程。A Binder object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.

-或--or- null,則使用 DefaultBindernull, to use the DefaultBinder.

returnType
Type Type Type Type

屬性的傳回類型。The return type of the property.

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

-或--or- 用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

modifiers
ParameterModifier[]

ParameterModifier 物件的陣列,代表在 types 陣列中與對應項目關聯的屬性。An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. 預設的繫結器不會處理這個參數。The default binder does not process this parameter.

傳回

PropertyInfo 物件,表示符合指定之需求的屬性 (如有找到);否則為 nullA PropertyInfo object representing the property that matches the specified requirements, if found; otherwise, null.

備註

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

Type.GetProperty方法會使用指定的系結條件約束,搜尋指定的屬性,其參數符合指定的引數類型和修飾詞。The Type.GetProperty method searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.

GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[]) GetProperty(String, Type, Type[])

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types);
abstract member GetProperty : string * Type * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type()) As PropertyInfo

參數

name
String String String String

String,包含要取得的公用屬性名稱。The String containing the name of the public property to get.

returnType
Type Type Type Type

屬性的傳回型別。The return type of the property.

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

-或--or- 用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

傳回

PropertyInfo 物件,表示其參數符合指定之引數類型的公用屬性 (如有找到);否則為 nullA PropertyInfo object representing the public property whose parameters match the specified argument types, if found; otherwise, null.

備註

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

Type.GetProperty方法會搜尋指定的公用屬性,其參數符合指定的引數類型。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types.

GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type) GetProperty(String, Type)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType);
abstract member GetProperty : string * Type -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type) As PropertyInfo

參數

name
String String String String

String,包含要取得的公用屬性名稱。The String containing the name of the public property to get.

returnType
Type Type Type Type

屬性的傳回類型。The return type of the property.

傳回

PropertyInfo 物件,表示具有指定之名稱的公用屬性 (如有找到);否則為 nullA PropertyInfo object representing the public property with the specified name, if found; otherwise, null.

備註

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

Type.GetProperty方法會搜尋具有指定之名稱和傳回型別的公用屬性。The Type.GetProperty method searches for the public property with the specified name and return type.

GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[]) GetProperty(String, Type[])

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type[] types);
abstract member GetProperty : string * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, types As Type()) As PropertyInfo

參數

name
String String String String

String,包含要取得的公用屬性名稱。The String containing the name of the public property to get.

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.

-或--or- 用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.

傳回

PropertyInfo 物件,表示其參數符合指定之引數類型的公用屬性 (如有找到);否則為 nullA PropertyInfo object representing the public property whose parameters match the specified argument types, if found; otherwise, null.

備註

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

Type.GetProperty方法會搜尋指定的公用屬性,其參數符合指定的引數類型。The Type.GetProperty method searches for the specified public property whose parameters match the specified argument types.

GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags) GetProperty(String, BindingFlags)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags) As PropertyInfo

參數

name
String String String String

String,包含要取得的屬性名稱。The String containing the name of the property to get.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

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

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

傳回

PropertyInfo 物件,表示符合指定之需求的屬性 (如有找到);否則為 nullA PropertyInfo object representing the property that matches the specified requirements, if found; otherwise, null.

備註

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

Type.GetProperty方法會使用指定的系結條件約束,搜尋指定的屬性。The Type.GetProperty method searches for the specified property, using the specified binding constraints.

GetProperty(String) GetProperty(String) GetProperty(String) GetProperty(String)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name);
public System.Reflection.PropertyInfo GetProperty (string name);
abstract member GetProperty : string -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String) As PropertyInfo

參數

name
String String String String

String,包含要取得的公用屬性名稱。The String containing the name of the public property to get.

傳回

PropertyInfo 物件,表示具有指定之名稱的公用屬性 (如有找到);否則為 nullA PropertyInfo object representing the public property with the specified name, if found; otherwise, null.

備註

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

Type.GetProperty方法會搜尋具有指定之名稱的公用屬性。The Type.GetProperty method searches for the public property with the specified name.

適用於