Convert.Coerce(Object, Object) Método

Definição

Converte o valor especificado no tipo especificado.Converts the specified value to the specified type.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 static System::Object ^ Coerce(System::Object ^ value, System::Object ^ type);
public static object Coerce (object value, object type);
static member Coerce : obj * obj -> obj
Public Shared Function Coerce (value As Object, type As Object) As Object

Parâmetros

value
Object

O valor a ser convertido em um novo tipo.The value to convert to a new type.

type
Object

O tipo no qual converter value.The type to convert value to.

Retornos

Object

value convertido em type.value converted to type.

Comentários

Esse método não permite conversões que causam perda de informações, como a conversão de 1,5 em um número inteiro.This method does not allow conversions that cause a loss of information, such as converting 1.5 to an integer.

Aplica-se a