ServiceController Constructor (String, String)

ServiceController Constructor (String, String)


Initializes a new instance of the ServiceController class that is associated with an existing service on the specified computer.

Namespace:   System.ServiceProcess
Assembly:  System.ServiceProcess (in System.ServiceProcess.dll)

Public Sub New (
	name As String,
	machineName As String


Type: System.String

The name that identifies the service to the system. This can also be the display name for the service.

Type: System.String

The computer on which the service resides.

Exception Condition

name is invalid.


machineName is invalid.

For the machineName parameter, you can use "." to represent the local computer.

.NET Framework
Available since 1.1
Return to top
© 2016 Microsoft