Conversions.ChangeType(Object, Type) 方法

定义

将对象转换为指定类型。

public:
 static System::Object ^ ChangeType(System::Object ^ Expression, Type ^ TargetType);
public static object ChangeType (object Expression, Type TargetType);
public static object? ChangeType (object? Expression, Type TargetType);
static member ChangeType : obj * Type -> obj
Public Shared Function ChangeType (Expression As Object, TargetType As Type) As Object

参数

Expression
Object

要转换的对象。

TargetType
Type

该对象要转换为的类型。

返回

指定的目标类型的对象。

适用于