IFormatterConverter.Convert 方法

定義

將值轉換為指定型別。Converts a value to a given type.

多載

Convert(Object, Type)

將值轉換為指定的 TypeConverts a value to the given Type.

Convert(Object, TypeCode)

將值轉換為指定的 TypeCodeConverts a value to the given TypeCode.

Convert(Object, Type)

將值轉換為指定的 TypeConverts a value to the given Type.

public:
 System::Object ^ Convert(System::Object ^ value, Type ^ type);
public object Convert (object value, Type type);
abstract member Convert : obj * Type -> obj

參數

value
Object

要轉換的物件。The object to be converted.

type
Type

Typevalue 要轉換為該型別。The Type into which value is to be converted.

傳回

已轉換的 valueThe converted value.

Convert(Object, TypeCode)

將值轉換為指定的 TypeCodeConverts a value to the given TypeCode.

public:
 System::Object ^ Convert(System::Object ^ value, TypeCode typeCode);
public object Convert (object value, TypeCode typeCode);
abstract member Convert : obj * TypeCode -> obj

參數

value
Object

要轉換的物件。The object to be converted.

typeCode
TypeCode

TypeCodevalue 要轉換為該型別。The TypeCode into which value is to be converted.

傳回

已轉換的 valueThe converted value.

適用於