Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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 ServiceController(
	string name,
	string machineName


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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft