Export (0) Print
Expand All

ServiceBase.OnShutdown Method

When implemented in a derived class, executes when the system is shutting down. Specifies what should happen immediately prior to the system shutting down.

[Visual Basic]
Protected Overridable Sub OnShutdown()
[C#]
protected virtual void OnShutdown();
[C++]
protected: virtual void OnShutdown();
[JScript]
protected function OnShutdown();

Remarks

Use OnShutdown to specify the processing that occurs when the system shuts down. Often, OnShutdown will be similar to the processing in OnStop. This event occurs only when the operating system is shut down, not when the computer is turned off.

OnShutdown is expected to be overridden when the CanShutdown property is true.

Requirements

Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ServiceBase Class | ServiceBase Members | System.ServiceProcess Namespace | CanShutdown | OnContinue | OnPause | OnPowerEvent | OnStart | OnStop | OnCustomCommand

Show:
© 2014 Microsoft