This documentation is archived and is not being maintained.

ServiceController Members

ServiceController overview

Public Constructors

public constructorServiceController Constructor Overloaded. Initializes a new instance of the ServiceController class.

Public Properties

public propertyCanPauseAndContinue Gets a value indicating whether the service can be paused and resumed.
public propertyCanShutdown Gets a value indicating whether the service should be notified when the system is shutting down.
public propertyCanStop Gets a value indicating whether the service can be stopped after it has started.
public propertyContainer (inherited from Component) Gets the IContainer that contains the Component.
public propertyDependentServices Gets the set of services that depends on the service associated with this ServiceController instance.
public propertyDisplayName Gets or sets a friendly name for the service.
public propertyMachineName Gets or sets the name of the computer on which this service resides.
public propertyServiceName Gets or sets the name that identifies the service that this instance references.
public propertyServicesDependedOn The set of services that this service depends on.
public propertyServiceType Gets the type of service that this object references.
public propertySite (inherited from Component) Gets or sets the ISite of the Component.
public propertyStatus Gets the status of the service that is referenced by this instance.

Public Methods

public methodClose Disconnects this ServiceController instance from the service and frees all the resources that the instance allocated.
public methodContinue Continues a service after it has been paused.
public methodCreateObjRef (inherited from MarshalByRefObject) Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
public methodDispose (inherited from Component) Overloaded. Releases the resources used by the Component.
public methodEquals (inherited from Object) Overloaded. Determines whether two Object instances are equal.
public methodExecuteCommand Executes a custom command on the service.
public methodstatic (Shared in Visual Basic)GetDevices Overloaded. Retrieves the device driver services on a computer.
public methodGetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
public methodGetLifetimeService (inherited from MarshalByRefObject) Retrieves the current lifetime service object that controls the lifetime policy for this instance.
public methodstatic (Shared in Visual Basic)GetServices Overloaded. Retrieves the non-device driver services on a computer, and those that are not drivers.
public methodGetType (inherited from Object) Gets the Type of the current instance.
public methodInitializeLifetimeService (inherited from MarshalByRefObject) Obtains a lifetime service object to control the lifetime policy for this instance.
public methodPause Suspends a service's operation.
public methodRefresh Refreshes all the property values, setting them to the current values.
public methodStart Overloaded. Starts the service.
public methodStop Stops this service and any services that are dependent on this service.
public methodToString (inherited from Object) Returns a String that represents the current Object.
public methodWaitForStatus Overloaded. Waits for the service to reach the specified status.

Public Events

public eventDisposed (inherited from Component) Adds an event handler to listen to the Disposed event on the component.

Protected Properties

protected propertyDesignMode (inherited from Component) Gets a value that indicates whether the Component is currently in design mode.
protected propertyEvents (inherited from Component) Gets the list of event handlers that are attached to this Component.

Protected Methods

protected methodDispose Overloaded. Overridden. See Component.Dispose.
protected methodFinalize (inherited from Component) Overridden. Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.

In C# and C++, finalizers are expressed using destructor syntax.

protected methodGetService (inherited from Component) Returns an object that represents a service provided by the Component or by its Container.
protected methodMemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

ServiceController Class | System.ServiceProcess Namespace