In The Hand - .NET Components for Mobility
ServiceController Constructor
NamespacesInTheHand.ServiceProcessServiceControllerServiceController()()()
Initializes a new instance of the ServiceController class that is not associated with a specific service.
Declaration Syntax
C#Visual Basic
public ServiceController()
Public Sub New
Remarks
Under Windows CE all services are identified with a device style prefix and index e.g. APP0:
Examples
Toggles the state of the Obex listener service
CopyC#
[VB]
            Dim sc As New ServiceController("OBX0:")
            If sc.Status = ServiceControllerStatus.Running Or sc.Status = ServiceControllerStatus.StartPending Then
                sc.Stop()
            Else
                sc.Start()
            End If
CopyC#
[C#]
            ServiceController sc = new ServiceController("OBX0:");
            if(sc.Status==ServiceControllerStatus.Running | sc.Status==ServiceControllerStatus.StartPending)
            {
                sc.Stop();
            }
            else
            {
                sc.Start();
            }

Assembly: InTheHand.ServiceProcess (Module: InTheHand.ServiceProcess) Version: 1.0.50819.0