ServiceControllerStatus Enumeration

 

Indicates the current state of the service.

Namespace:   System.ServiceProcess
Assembly:  System.ServiceProcess (in System.ServiceProcess.dll)

type ServiceControllerStatus

Member nameDescription
ContinuePending

The service continue is pending. This corresponds to the Win32 SERVICE_CONTINUE_PENDING constant, which is defined as 0x00000005.

Paused

The service is paused. This corresponds to the Win32 SERVICE_PAUSED constant, which is defined as 0x00000007.

PausePending

The service pause is pending. This corresponds to the Win32 SERVICE_PAUSE_PENDING constant, which is defined as 0x00000006.

Running

The service is running. This corresponds to the Win32 SERVICE_RUNNING constant, which is defined as 0x00000004.

StartPending

The service is starting. This corresponds to the Win32 SERVICE_START_PENDING constant, which is defined as 0x00000002.

Stopped

The service is not running. This corresponds to the Win32 SERVICE_STOPPED constant, which is defined as 0x00000001.

StopPending

The service is stopping. This corresponds to the Win32 SERVICE_STOP_PENDING constant, which is defined as 0x00000003.

The ServiceControllerStatus enumeration is used by an instance of the ServiceController class to indicate whether an existing service is running, stopped, paused, or whether a Start, Stop, Pause, or Continue command is pending.

The following example uses the ServiceController class to check the current status of the TelNet service. If the service is stopped, the example starts the service. If the service is running, the example stops the service.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: