ServiceController Methods

The ServiceController type exposes the following members.

  Name Description
Public method Close Disconnects this ServiceController instance from the service and frees all the resources that the instance allocated.
Public method Continue Continues a service after it has been paused.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method Dispose() Releases all resources used by the Component. (Inherited from Component.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the ServiceController and optionally releases the managed resources. (Overrides Component.Dispose(Boolean).)
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method ExecuteCommand Executes a custom command on the service.
Protected method Finalize Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public method Static member GetDevices() Retrieves the device driver services on the local computer.
Public method Static member GetDevices(String) Retrieves the device driver services on the specified computer.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method GetService Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public method Static member GetServices() Retrieves all the services on the local computer, except for the device driver services.
Public method Static member GetServices(String) Retrieves all the services on the specified computer, except for the device driver services.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected method MemberwiseClone() Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MemberwiseClone(Boolean) Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public method Pause Suspends a service's operation.
Public method Refresh Refreshes property values by resetting the properties to their current values.
Public method Start() Starts the service, passing no arguments.
Public method Start(String[]) Starts a service, passing the specified arguments.
Public method Stop Stops this service and any services that are dependent on this service.
Public method ToString Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)
Public method WaitForStatus(ServiceControllerStatus) Infinitely waits for the service to reach the specified status.
Public method WaitForStatus(ServiceControllerStatus, TimeSpan) Waits for the service to reach the specified status or for the specified time-out to expire.
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft