Conversions.ChangeType(Object, Type) Metódus

Definíció

Egy objektumot a megadott típussá alakít át.

public:
 static System::Object ^ ChangeType(System::Object ^ Expression, Type ^ TargetType);
public static object ChangeType(object Expression, Type TargetType);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Expression origin object cannot be statically analyzed and may be trimmed")]
public static object? ChangeType(object? Expression, Type TargetType);
public static object? ChangeType(object? Expression, Type TargetType);
static member ChangeType : obj * Type -> obj
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Expression origin object cannot be statically analyzed and may be trimmed")>]
static member ChangeType : obj * Type -> obj
Public Shared Function ChangeType (Expression As Object, TargetType As Type) As Object

Paraméterek

Expression
Object

Az átalakítandó objektum.

TargetType
Type

Az objektum konvertálásának típusa.

Válaszok

A megadott céltípusú objektum.

Attribútumok

A következőre érvényes: