|
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
|
TimeoutException, classe
Assembly : mscorlib (dans mscorlib.dll)
Le type TimeoutException expose les membres suivants.
| Nom | Description | |
|---|---|---|
![]() ![]() ![]() | TimeoutException() | |
![]() ![]() ![]() | TimeoutException(String) | |
![]() | TimeoutException(SerializationInfo, StreamingContext) | |
![]() ![]() ![]() | TimeoutException(String, Exception) |
| Nom | Description | |
|---|---|---|
![]() | Data | |
![]() | HelpLink | |
![]() ![]() ![]() | HResult | |
![]() ![]() ![]() | InnerException | |
![]() ![]() ![]() | Message | |
![]() | 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 |
// This example demonstrates the use of the TimeoutException // exception in conjunction with the SerialPort class. using System; using System.IO.Ports; class Sample { public static void Main() { string input; try { // Set the COM1 serial port to speed = 4800 baud, parity = odd, // data bits = 8, stop bits = 1. SerialPort sp = new SerialPort("COM1", 4800, Parity.Odd, 8, StopBits.One); // Timeout after 2 seconds. sp.ReadTimeout = 2000; sp.Open(); // Read until either the default newline termination string // is detected or the read operation times out. input = sp.ReadLine(); sp.Close(); // Echo the input. Console.WriteLine(input); } // Only catch timeout exceptions. catch (TimeoutException e) { Console.WriteLine(e); } } } /* This example produces the following results: (Data received at the serial port is echoed to the console if the read operation completes successfully before the specified timeout period expires. Otherwise, a timeout exception like the following is thrown.) System.TimeoutException: The operation has timed-out. at System.IO.Ports.SerialStream.ReadByte(Int32 timeout) at System.IO.Ports.SerialPort.ReadOneChar(Int32 timeout) at System.IO.Ports.SerialPort.ReadTo(String value) at System.IO.Ports.SerialPort.ReadLine() at Sample.Main() */
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.


