サービスが指定したステータスになるまで、または指定したタイムアウトの期限が切れるまで待機します。
Overloads Public Sub WaitForStatus( _
ByVal desiredStatus As ServiceControllerStatus, _ ByVal timeout As TimeSpan _)
[C#]
public void WaitForStatus(ServiceControllerStatusdesiredStatus,TimeSpantimeout);
[C++]
public: void WaitForStatus(ServiceControllerStatusdesiredStatus,TimeSpantimeout);
[JScript]
public function WaitForStatus(
desiredStatus : ServiceControllerStatus,timeout : TimeSpan);
パラメータ
- desiredStatus
待機に対するステータス。 - timeout
サービスが指定したステータスになるまでの待機時間。
例外
例外の種類 | 条件 |
---|---|
InvalidEnumArgumentException | desiredStatus パラメータが、 ServiceControllerStatus 列挙体で定義されている値ではありません。 |
TimeoutException | timeout パラメータに指定されている値の有効期限が切れています。 |
解説
サービスが目的のステータスになるまで、アプリケーションの処理を中断するには、 WaitForStatus を使用します。
必要条件
プラットフォーム: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
ServiceController クラス | ServiceController メンバ | System.ServiceProcess 名前空間 | ServiceController.WaitForStatus オーバーロードの一覧 | Status