ServiceController.CanPauseAndContinue 속성

정의

서비스를 일시 중지했다가 다시 시작할 수 있는지를 나타내는 값을 가져옵니다.

public:
 property bool CanPauseAndContinue { bool get(); };
public bool CanPauseAndContinue { get; }
[System.ServiceProcess.ServiceProcessDescription("SPCanPauseAndContinue")]
public bool CanPauseAndContinue { get; }
member this.CanPauseAndContinue : bool
[<System.ServiceProcess.ServiceProcessDescription("SPCanPauseAndContinue")>]
member this.CanPauseAndContinue : bool
Public ReadOnly Property CanPauseAndContinue As Boolean

속성 값

Boolean

서비스를 일시 중지할 수 있으면 true이고, 그렇지 않으면 false입니다.

특성

예외

시스템 API에 액세스할 때 오류가 발생했습니다.

서비스를 찾을 수 없습니다.

예제

다음 예제에서는 서비스를 일시 중지 하 고 계속할 수 있는지 여부를 결정 하는 속성을 사용 CanPauseAndContinue 하는 방법을 보여 줍니다. 이 예제는 클래스에 대해 제공되는 더 큰 예제의 ServiceController 일부입니다.

// Display properties for the Simple Service sample
// from the ServiceBase example.
ServiceController sc = new ServiceController("Simple Service");
Console.WriteLine("Status = " + sc.Status);
Console.WriteLine("Can Pause and Continue = " + sc.CanPauseAndContinue);
Console.WriteLine("Can ShutDown = " + sc.CanShutdown);
Console.WriteLine("Can Stop = " + sc.CanStop);
' Display properties for the Simple Service sample 
' from the ServiceBase example
Dim sc As New ServiceController("Simple Service")
Console.WriteLine("Status = " + sc.Status.ToString())
Console.WriteLine("Can Pause and Continue = " + _
    sc.CanPauseAndContinue.ToString())
Console.WriteLine("Can ShutDown = " + sc.CanShutdown.ToString())
Console.WriteLine("Can Stop = " + sc.CanStop.ToString())

적용 대상