Cet article a fait l'objet d'une traduction manuelle. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte.
Traduction
Source
Ce sujet n'a pas encore été évalué - Évaluez ce sujet

Convert.ToInt64, méthode (UInt32)

Convertit la valeur de l'entier non signé 32 bits spécifié en un entier signé 64 bits équivalent.

Cette API n'est pas conforme CLS. 

Espace de noms :  System
Assembly :  mscorlib (dans mscorlib.dll)
[CLSCompliantAttribute(false)]
public static long ToInt64(
	uint value
)

Paramètres

value
Type : System.UInt32
Entier non signé 32 bits à convertir.

Valeur de retour

Type : System.Int64
Entier signé 64 bits équivalent à value.

L'exemple suivant convertit chaque élément dans un tableau d'entiers non signés en entier long.


uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
long result;
foreach (uint number in numbers)
{
   try {
      result = Convert.ToInt64(number);
      Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
                        number.GetType().Name, number,
                        result.GetType().Name, result);
   }
   catch (OverflowException) {
      Console.WriteLine("The {0} value {1} is outside the range of the Int64 type.",
                        number.GetType().Name, number);
   }
}
// The example displays the following output:
//    Converted the UInt32 value 0 to the Int64 value 0.
//    Converted the UInt32 value 121 to the Int64 value 121.
//    Converted the UInt32 value 340 to the Int64 value 340.
//    The UInt32 value 4294967295 is outside the range of the Int64 type.


.NET Framework

Pris en charge dans : 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Pris en charge dans : 4, 3.5 SP1

Pris en charge dans :

Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2

Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Cela vous a-t-il été utile ?
(1500 caractères restants)

Ajouts de la communauté

AJOUTER
© 2013 Microsoft. Tous droits réservés.