Start stop Service from Form App c#
Add a reference to System.ServiceProcess.dll. Then you can use the ServiceController class. // Check whether the Alerter service is started. ServiceController sc = new ServiceController(); sc.ServiceName = “Alerter”; Console.WriteLine(“The Alerter service status is currently set to {0}”, sc.Status.ToString()); if (sc.Status == ServiceControllerStatus.Stopped) { // Start the service if the current status is stopped. Console.WriteLine(“Starting the … Read more