ValueProviderResult.ConvertTo 方法

定义

将此结果封装的值转换为指定的类型。Converts a value that is encapsulated by this result to the specified type.

重载

ConvertTo(Type)

将此结果封装的值转换为指定的类型。Converts a value that is encapsulated by this result to the specified type.

ConvertTo(Type, CultureInfo)

使用指定的区域性信息将此结果封装的值转换为指定的类型。Converts the value that is encapsulated by this result to the specified type by using the specified culture information.

ConvertTo(Type)

将此结果封装的值转换为指定的类型。Converts a value that is encapsulated by this result to the specified type.

public:
 System::Object ^ ConvertTo(Type ^ type);
public object ConvertTo (Type type);
member this.ConvertTo : Type -> obj
Public Function ConvertTo (type As Type) As Object

参数

type
Type

类型。The type.

返回

Object

转换后的值。The converted value.

例外

type 参数为 nullThe type parameter is null.

转换不成功。Conversion was unsuccessful.

适用于

ConvertTo(Type, CultureInfo)

使用指定的区域性信息将此结果封装的值转换为指定的类型。Converts the value that is encapsulated by this result to the specified type by using the specified culture information.

public:
 virtual System::Object ^ ConvertTo(Type ^ type, System::Globalization::CultureInfo ^ culture);
public virtual object ConvertTo (Type type, System.Globalization.CultureInfo culture);
abstract member ConvertTo : Type * System.Globalization.CultureInfo -> obj
override this.ConvertTo : Type * System.Globalization.CultureInfo -> obj
Public Overridable Function ConvertTo (type As Type, culture As CultureInfo) As Object

参数

type
Type

类型。The type.

culture
CultureInfo

区域性信息。The culture information.

返回

Object

转换后的值。The converted value.

例外

type 参数为 nullThe type parameter is null.

转换不成功。Conversion was unsuccessful.

适用于