ServiceController.CanShutdown Özellik

Tanım

Sistem kapatılırken hizmete bildirim gönderilip bildirilmeyeceğini belirten bir değer alır.

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

Özellik Değeri

Boolean

true sistem kapatılırken hizmete bildirilmesi gerekiyorsa; aksi takdirde , false.

Öznitelikler

Özel durumlar

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

Hizmet bulunamadı.

Örnekler

Aşağıdaki örnek, bir hizmetin kapatma olayı için işleyici sağlayıp sağlamadığını belirlemek için özelliğinin kullanımını CanShutdown gösterir. Bu örnek, sınıfı için ServiceController sağlanan daha büyük bir örneğin 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