ArgumentException, classe
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. Dans , 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 , 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 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.
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






