ServiceInstaller.StartType 屬性

定義

表示啟動此服務的方式和時間。

public:
 property System::ServiceProcess::ServiceStartMode StartType { System::ServiceProcess::ServiceStartMode get(); void set(System::ServiceProcess::ServiceStartMode value); };
public System.ServiceProcess.ServiceStartMode StartType { get; set; }
[System.ServiceProcess.ServiceProcessDescription("ServiceInstallerStartType")]
public System.ServiceProcess.ServiceStartMode StartType { get; set; }
member this.StartType : System.ServiceProcess.ServiceStartMode with get, set
[<System.ServiceProcess.ServiceProcessDescription("ServiceInstallerStartType")>]
member this.StartType : System.ServiceProcess.ServiceStartMode with get, set
Public Property StartType As ServiceStartMode

屬性值

ServiceStartMode

ServiceStartMode,表示服務啟動的方式。 預設值為 Manual,其指定服務在重新開機後將不會自動啟動。

屬性

例外狀況

啟動模式不是 ServiceStartMode 列舉的值。

備註

將設定 StartType 為,指定在重新開機後自動啟動服務,或使用者必須手動啟動服務。 您也可以停用服務,指定它在啟用之前,無法以手動或程式設計方式啟動。

您無法 ServiceInstaller 在安裝後變更屬性值。 若要變更 StartType ,您必須卸載並重新安裝您的服務,或使用服務控制管理員手動變更設定。

適用於

另請參閱