|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
ArgumentException, classe
Espace de noms : System
Assembly : mscorlib (dans mscorlib.dll)
Le type ArgumentException expose les membres suivants.
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() ![]() | ArgumentException() | |
![]() ![]() ![]() ![]() | ArgumentException(String) | |
![]() | ArgumentException(SerializationInfo, StreamingContext) | |
![]() ![]() ![]() ![]() | ArgumentException(String, Exception) | |
![]() ![]() ![]() ![]() | ArgumentException(String, String) | |
![]() ![]() ![]() | ArgumentException(String, String, Exception) |
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() | Data | |
![]() ![]() ![]() | HelpLink | |
![]() ![]() ![]() ![]() | HResult | |
![]() ![]() ![]() ![]() | InnerException | |
![]() ![]() | Message | Dans XNA Framework 3.0, ce membre est hérité de Exception.Message. |
![]() ![]() ![]() | ParamName | |
![]() ![]() ![]() | Source | |
![]() ![]() ![]() ![]() | StackTrace | |
![]() | TargetSite |
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() ![]() | Equals(Object) | |
![]() ![]() ![]() ![]() | Finalize | |
![]() ![]() ![]() ![]() | GetBaseException | |
![]() ![]() ![]() ![]() | GetHashCode | |
![]() | GetObjectData | |
![]() ![]() ![]() ![]() | GetType | Dans XNA Framework 3.0, ce membre est hérité de Object.GetType(). Dans Bibliothèque de classes portable Bibliothèque de classes portable, ce membre est hérité de Object.GetType(). Dans .NET pour les applications du Windows Store Windows 8, ce membre est hérité de Object.GetType(). |
![]() ![]() ![]() ![]() | MemberwiseClone | |
![]() ![]() ![]() ![]() | ToString |
| Nom | Description | |
|---|---|---|
![]() | SerializeObjectState |
ArgumentNullException chaque fois que null est passé à une méthode pour laquelle cet argument n'est pas valide. ArgumentOutOfRangeException lorsque la valeur d'un argument ne figure pas dans la plage des valeurs autorisées, par exemple, lorsque la valeur "46" est passée à l'argument du mois durant la création de DateTime.
using System; public sealed class App { static void Main() { // ArgumentException is not thrown because 10 is an even number. Console.WriteLine("10 divided by 2 is {0}", DivideByTwo(10)); try { // ArgumentException is thrown because 7 is not an even number. Console.WriteLine("7 divided by 2 is {0}", DivideByTwo(7)); } catch (ArgumentException) { // Show the user that 7 cannot be divided by 2. Console.WriteLine("7 is not divided by 2 integrally."); } } static int DivideByTwo(int num) { // If num is an odd number, throw an ArgumentException. if ((num & 1) == 1) throw new ArgumentException("Number must be even", "num"); // num is even, return half of its value. return num / 2; } } // This code produces the following output. // // 10 divided by 2 is 5 // 7 is not divided by 2 integrally.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
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.
System.Exception
System.SystemException
System.ArgumentException
System.ArgumentNullException
System.ArgumentOutOfRangeException
System.ComponentModel.InvalidAsynchronousStateException
System.ComponentModel.InvalidEnumArgumentException
System.DuplicateWaitObjectException
System.Globalization.CultureNotFoundException
System.IO.Log.ReservationNotFoundException
System.Text.DecoderFallbackException
System.Text.EncoderFallbackException



