TimeoutException クラス
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)


TimeoutException クラスでは、例外の原因を説明するメッセージを指定できます。通常、この例外がメソッドによってスローされる場合は、"指定したタイムアウトが経過したため、操作は完了しませんでした。" などのメッセージが表示されます。
たとえば、このクラスは、ServiceController クラスの WaitForStatus メンバによって使用されます。サービスの Status プロパティを Paused から ContinuePending に変更するなどの操作を行うと、この例外がスローされる可能性があります。

System.Exception
System.SystemException
System.ServiceProcess.TimeoutException


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Class TimeoutException Inherits SystemException
[SerializableAttribute] [ComVisibleAttribute(true)] public ref class TimeoutException : public SystemException

TimeoutException は、値 0x80131505 を保持する HRESULT, COR_E_TIMEOUT を使用します。
TimeoutException のインスタンスの初期プロパティ値の一覧については、TimeoutException コンストラクタのトピックを参照してください。

System.IO.Ports.SerialPort クラスのメンバと組み合わせて TimeoutException を使用するコード例を次に示します。
' This example demonstrates the use of the TimeoutException ' exception in conjunction with the SerialPort class. Imports System Imports System.IO.Ports Class Sample Public Shared Sub Main() Dim input As String Try ' Set the COM1 serial port to speed = 4800 baud, parity = odd, ' data bits = 8, stop bits = 1. Dim sp As 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 e As TimeoutException Console.WriteLine(e) End Try End Sub 'Main End Class 'Sample ' '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() '
// 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() */
// This example demonstrates the use of the TimeoutException // exception in conjunction with the SerialPort class. #using <System.dll> using namespace System; using namespace System::IO::Ports; int main() { String^ input; try { // Set the COM1 serial port to speed = 4800 baud, parity = odd , // data bits = 8, stop bits = 1. SerialPort^ port = gcnew SerialPort("COM1", 4800, Parity::Odd, 8, StopBits::One); // Timeout after 2 seconds. port->ReadTimeout = 2000; port->Open(); // Read until either the default newline termination string // is detected or the read operation times out. input = port->ReadLine(); port->Close(); // Echo the input. Console::WriteLine(input); } // Only catch timeout exceptions. catch (TimeoutException^ ex) { Console::WriteLine(ex); } }; /* 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() */
// This example demonstrates the use of the TimeoutException // exception in conjunction with the SerialPort class. import System.*; import System.IO.Ports.*; class Sample { public static void main(String[] args) { 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.set_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); } } //main } //Sample /* 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() */

System.Exception
System.SystemException
System.TimeoutException


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ ()
アセンブリ: mscorlib (mscorlib.dll 内)


このコンストラクタは、システム提供のエラー メッセージを使用して、新しいインスタンスの継承した Exception.Message プロパティを初期化します。このメッセージは、システムの現在のカルチャを考慮して指定します。
TimeoutException のインスタンスの初期プロパティ値を次の表に示します。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ ()
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)



Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (String)
アセンブリ: mscorlib (mscorlib.dll 内)


このコンストラクタは、message パラメータの値を使用して、新しいインスタンスの継承した Exception.Message プロパティを初期化します。
TimeoutException のインスタンスの初期プロパティ値を次の表に示します。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (SerializationInfo, StreamingContext)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim info As SerializationInfo Dim context As StreamingContext Dim instance As New TimeoutException(info, context)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (String, Exception)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim message As String Dim innerException As Exception Dim instance As New TimeoutException(message, innerException)

このコンストラクタは、message パラメータの値を使用して、新しいインスタンスの継承した Exception.Message プロパティを初期化します。
前の例外の直接の結果としてスローされる例外については、InnerException プロパティに、前の例外への参照が格納されます。InnerException プロパティは、コンストラクタに渡された値と同じ値を返します。InnerException プロパティによって内部例外値がコンストラクタに渡されなかった場合は、null 参照 (Visual Basic では Nothing) を返します。
TimeoutException のインスタンスの初期プロパティ値を次の表に示します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (String)
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)



Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (SerializationInfo, StreamingContext)
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)

Dim info As SerializationInfo Dim context As StreamingContext Dim instance As New TimeoutException(info, context)



Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ (String, Exception)
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)

Dim message As String Dim innerException As Exception Dim instance As New TimeoutException(message, innerException)


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TimeoutException コンストラクタ

名前 | 説明 |
---|---|
TimeoutException () | メッセージ テキストを指定せずに、TimeoutException クラスの新しいインスタンスを初期化します。 |
TimeoutException (String) | メッセージ テキストを指定して、TimeoutException クラスの新しいインスタンスを初期化します。 |
TimeoutException (SerializationInfo, StreamingContext) | 指定したシリアル化情報とコンテキストを使用して、TimeoutException クラスの新しいインスタンスを初期化します。 |
TimeoutException (String, Exception) | 指定したメッセージ テキストと内部例外を使用して、TimeoutException クラスの新しいインスタンスを初期化します。 |

TimeoutException コンストラクタ

名前 | 説明 |
---|---|
TimeoutException () | TimeoutException クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
TimeoutException (String) | TimeoutException クラスの新しいインスタンスを、指定したエラー メッセージを使用して初期化します。 .NET Compact Framework によってサポートされています。 |
TimeoutException (SerializationInfo, StreamingContext) | シリアル化したデータを使用して、TimeoutException クラスの新しいインスタンスを初期化します。 |
TimeoutException (String, Exception) | 指定したエラー メッセージと内部例外を使用して、TimeoutException クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

TimeoutException プロパティ

名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。 ( Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。 ( Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。 ( Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。 ( Exception から継承されます。) |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。 ( Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。 ( Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。 ( Exception から継承されます。) |


TimeoutException プロパティ

名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。 ( Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。 ( Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。 ( Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。 ( Exception から継承されます。) |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。 ( Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。 ( Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。 ( Exception から継承されます。) |


TimeoutException メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 ( Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetObjectData | 派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。 ( Exception から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 ( Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 ( Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

TimeoutException メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 ( Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetObjectData | 派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。 ( Exception から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 ( Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 ( Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

TimeoutException メンバ
TimeoutException データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。(Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。(Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。(Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。(Exception から継承されます。) |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。(Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。(Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。(Exception から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 (Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetObjectData | 派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。 (Exception から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 (Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 (Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

TimeoutException メンバ
プロセスまたは操作用に割り当てられた時間が経過したときにスローされる例外。
TimeoutException データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。(Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。(Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。(Exception から継承されます。) |
![]() | Message | 現在の例外を説明するメッセージを取得します。(Exception から継承されます。) |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。(Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。(Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。(Exception から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 (Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetObjectData | 派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。 (Exception から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 (Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 (Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- TimeoutExceptionのページへのリンク