ObjectConverter.ConvertValue(Object, Type, String) 方法

定义

将对象从一种对象类型转换为另一种对象类型。 此类已过时。 请换用 Convert 类和 Format(String, Object) 方法。

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 static System::Object ^ ConvertValue(System::Object ^ value, Type ^ toType, System::String ^ formatString);
public static object ConvertValue (object value, Type toType, string formatString);
static member ConvertValue : obj * Type * string -> obj
Public Shared Function ConvertValue (value As Object, toType As Type, formatString As String) As Object

参数

value
Object

要转换的对象。

toType
Type

要将 value 转换为的 Type

formatString
String

要在转换过程中应用的格式字符串。

返回

Object

被转换的对象。

例外

无法通过此方法将 Value 转换为类型 toType

适用于