DBConvert.ChangeType 方法
定义
重载
| ChangeType(Object, Type) |
此 API 支持产品基础结构,不能在代码中直接使用。 将指定的值更改为指定类型。Changes the specified value to the specified type. |
| ChangeType<T>(Object) |
此 API 支持产品基础结构,不能在代码中直接使用。 将指定的值更改为当前类型。Changes the specified value to the current type. |
ChangeType(Object, Type)
将指定的值更改为指定类型。Changes the specified value to the specified type.
此 API 支持产品基础结构,不能在代码中直接使用。
public:
static System::Object ^ ChangeType(System::Object ^ value, Type ^ type);
public static object ChangeType (object value, Type type);
static member ChangeType : obj * Type -> obj
Public Shared Function ChangeType (value As Object, type As Type) As Object
参数
- value
- Object
要转换的对象。The object to be converted.
- type
- Type
对象要转换为的类型。The type to convert the object to.
返回
一个包含指定类型的转换值的对象。An object that contains the converted value of the specified type.
注解
重要
使用不受信任的数据调用此方法存在安全风险。Calling this method with untrusted data is a security risk. 仅使用受信任的数据调用此方法。Call this method only with trusted data. 有关详细信息,请参阅数据验证。For more information, see Data Validation.
适用于
ChangeType<T>(Object)
将指定的值更改为当前类型。Changes the specified value to the current type.
此 API 支持产品基础结构,不能在代码中直接使用。
public:
generic <typename T>
static T ChangeType(System::Object ^ value);
public static T ChangeType<T> (object value);
static member ChangeType : obj -> 'T
Public Shared Function ChangeType(Of T) (value As Object) As T
类型参数
- T
要更改为的类型。The type to change to.
参数
- value
- Object
要转换的对象。The object to be converted.
返回
- T
一个包含转换值的指定类型的对象。An object of the specified type that contains the converted value.
注解
重要
使用不受信任的数据调用此方法存在安全风险。Calling this method with untrusted data is a security risk. 仅使用受信任的数据调用此方法。Call this method only with trusted data. 有关详细信息,请参阅数据验证。For more information, see Data Validation.