語言

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

Type轉化value到那裡。

formatString
String

格式字串在轉換時套用。

傳回

被轉換的物品。

例外狀況

Value 此方法無法轉換為型別 toType 。

適用於