ObjectConverter.ConvertValue(Object, Type, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將物件從一種物件類型轉換成另一種物件類型。 這個類別已經過時。 還是用課程 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
要轉換的物件。
- formatString
- String
格式字串在轉換時套用。
傳回
被轉換的物品。
例外狀況
Value 此方法無法轉換為型別 toType 。