Installed Windows Services in C#
Join the DZone community and get the full member experience.
Join For Free
The following code checks whether a Windows service is installed on your machine or not:
public static void ISWindowsServiceInstalled(string serviceName) { // get list of Windows services ServiceController[] services = ServiceController.GetServices(); foreach (ServiceController service in services) { if (service.ServiceName == serviceName) return true; } return false; }
Published at DZone with permission of Amir Ahani, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments