ServiceController.CanPauseAndContinue Özellik

Tanım

Hizmetin duraklatılıp sürdürülemeyeceğini belirten bir değer alır.

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

Özellik Değeri

true hizmet duraklatılabilirse; aksi takdirde , false.

Öznitelikler

Özel durumlar

Sistem API'lerine erişilirken bir hata oluştu.

Hizmet bulunamadı.

Örnekler

Aşağıdaki örnekte, bir hizmetin duraklatılıp devam edip edilemeyeceğini belirlemek için özelliğinin CanPauseAndContinue kullanımı gösterilmektedir. Bu örnek, sınıfı için ServiceController sağlanan daha büyük bir örneğin bir parçasıdır.

// 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())

Şunlara uygulanır