DataBinder.GetPropertyValue 方法

定义

检索属性的值。

重载

名称 说明
GetPropertyValue(Object, String)

检索指定对象的指定属性的值。

GetPropertyValue(Object, String, String)

检索指定对象的指定属性的值,然后设置结果的格式。

GetPropertyValue(Object, String)

检索指定对象的指定属性的值。

public:
 static System::Object ^ GetPropertyValue(System::Object ^ container, System::String ^ propName);
public static object GetPropertyValue(object container, string propName);
static member GetPropertyValue : obj * string -> obj
Public Shared Function GetPropertyValue (container As Object, propName As String) As Object

参数

container
Object

包含属性的对象。

propName
String

包含要检索的值的属性的名称。

返回

指定属性的值。

例外

containernull

-或-

propNamenull 或空字符串(“)。

中的 container 对象没有由 propName. 指定的属性。

示例

该示例 DataBinder 演示如何使用此方法。

注解

该方法 GetPropertyValue 用于检索对象中属性的值。

适用于

GetPropertyValue(Object, String, String)

检索指定对象的指定属性的值,然后设置结果的格式。

public:
 static System::String ^ GetPropertyValue(System::Object ^ container, System::String ^ propName, System::String ^ format);
public static string GetPropertyValue(object container, string propName, string format);
static member GetPropertyValue : obj * string * string -> string
Public Shared Function GetPropertyValue (container As Object, propName As String, format As String) As String

参数

container
Object

包含属性的对象。

propName
String

包含要检索的值的属性的名称。

format
String

一个字符串,指定要在其中显示结果的格式。

返回

指定属性的值,格式由 format.

例外

containernull

-或-

propNamenull 或空字符串(“)。

中的 container 对象没有由 propName. 指定的属性。

示例

该示例 DataBinder 演示如何使用此方法。

注解

此版本的 GetPropertyValue 方法用于检索和格式化对象中属性的值。

适用于