troubleshooting Question

Start, Stop and know the status of windows services

Avatar of Sam T
Sam T asked on
C#Windows OSGolang
2 Comments1 Solution117 ViewsLast Modified:
I am creating windows services using C# , and configurator for the service using windows form app in C#. So, I want to include start, stop and know the state of the service( Running/Stopped) functionality on my configurator, how would I do this using C# ? So if I click start button it is going to start the service and if I click the Stop button it would stop the service, and text field should display the status of the service (running, or stopped).

 All I want to make my configurator user friendly, so that user don't have to go to Task Manger and manually stop or start the service. Not only for the service I created, but this would allow me to write any service name on the text field, and should give me service status, and if it is already running, and  I click stop button it should stop, if it is stopped, and I click start button it should run.
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros