Share via


ServiceBase.OnContinue 方法

定義

在衍生類別中實作時,當服務控制管理員 (SCM) 傳送繼續命令給服務時,將執行 OnContinue()。 指定暫停服務後要繼續正常運作所要執行的動作。

protected:
 virtual void OnContinue();
protected virtual void OnContinue ();
abstract member OnContinue : unit -> unit
override this.OnContinue : unit -> unit
Protected Overridable Sub OnContinue ()

備註

OnContinue 作 以鏡像應用程式的回應 OnPause 。 當您透過 Services 主控台或以程式設計方式) 繼續服務 (時, OnContinue 處理會執行,而服務會再次變成作用中。

OnContinue當 屬性為 trueCanPauseAndContinue ,預期會覆寫 。

如果 CanPauseAndContinuefalse ,則 SCM 不會將 Pause 或 Continue 要求傳遞至服務,因此 OnPause 即使實作和 方法,也不會呼叫 和 OnContinue 方法。 在 SCM 中,當 為 falseCanPauseAndContinuePause 會停用 和 Continue 控制項。

適用於

另請參閱