In The Hand LtdIn The Hand
ServiceController Constructor (name)
NamespacesInTheHand.ServiceProcessServiceControllerServiceController(String)
.NET Components for Mobility
Initializes a new instance of the ServiceController class that is associated with an existing service on the local device.
Declaration Syntax
C#Visual Basic
public ServiceController(
	string name
)
Public Sub New ( _
	name As String _
)
Parameters
name (String)
The short name that identifies the service to the system.
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
CopyVB.NET
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#
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: 7.0.0.0