Represents a Windows Embedded service and allows you to connect to a running or stopped service, manipulate it, or get information about it.
| C# | Visual Basic |
public sealed class ServiceController : Component, IDisposable
Public NotInheritable Class ServiceController _ Inherits Component _ Implements IDisposable
| All Members | Constructors | Methods | Properties | Events | |
| Icon | Member | Description |
|---|---|---|
| ServiceController(String, ServiceType) | Initializes a new instance of the ServiceController class | |
| ServiceController(String) |
Initializes a new instance of the ServiceController class that is associated with an existing service on the local device.
| |
| CanRaiseEvents |
Gets a value indicating whether the component can raise an event.
(Inherited from Component.) | |
| Close()()()() |
Disconnects this ServiceController instance from the service and frees all the resources that the instance allocated.
| |
| Container |
Gets the IContainer that contains the Component.
(Inherited from Component.) | |
| CreateObjRef(Type) |
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.) | |
| DesignMode |
Gets a value that indicates whether the Component is currently in design mode.
(Inherited from Component.) | |
| Dispose(Boolean) | Releases the unmanaged resources used by the ServiceController and optionally releases the managed resources (Overrides Component.Dispose(Boolean).) | |
| Dispose()()()() | Releases all resources used by the ServiceController | |
| Disposed |
Occurs when the component is disposed by a call to the Dispose()()()() method.
(Inherited from Component.) | |
| Equals(Object) | (Inherited from Object.) | |
| Events |
Gets the list of event handlers that are attached to this Component.
(Inherited from Component.) | |
| Finalize()()()() | (Overrides Component.Finalize()()()().) | |
| GetDevices()()()() |
Retrieves the device driver services on the local computer.
| |
| GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetLifetimeService()()()() |
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.) | |
| GetService(Type) | (Inherited from Component.) | |
| GetServices()()()() |
Retrieves all the services on the local computer, except for the device driver services.
| |
| GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| InitializeLifetimeService()()()() |
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.) | |
| MemberwiseClone(Boolean) |
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.) | |
| MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| ServiceName |
Gets or sets the name that identifies the service that this instance references.
| |
| ServiceType |
Gets the type of service that this object references.
| |
| Site | (Inherited from Component.) | |
| Start()()()() |
Starts the service.
| |
| Status |
Gets the status of the service that is referenced by this instance.
| |
| Stop()()()() |
Stops this service.
| |
| ToString()()()() |
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component.) |
You can use the ServiceController class to connect to and control the behavior of existing services.
When you create an instance of the ServiceController class, you set its properties so it interacts with a specific Windows service.
You can then use the class to start, stop, and otherwise manipulate the service.
| Platforms Supported | |
|---|---|
| Windows Mobile | Pocket PC 2003, Windows Mobile 5.0 and later |
| Windows Embedded Compact | Windows CE .NET 4.1 and later |
| Object | |||
| MarshalByRefObject | |||
| Component | |||
| ServiceController | |||