Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

C#
I have a requirement that i want to get all the system services running under system which will display the Services either in the Started or in Stopped.


How can i achieve this in C# using ADO.Net (Winforms). Below is the code format i follow from the link:

How to Create and Work With Windows Services in C#[^]

I can open the Services but can't display the services status in my application. Can anyone suggest me the alternative?

What I have tried:

I have tried the code which i mentioned above in the Describe the problem. With that code i can open the services but can't display the status of services.
Posted
Updated 9-Feb-16 2:49am
v2
Comments
Richard MacCutchan 9-Feb-16 5:54am    
Why have you typed the same question in both sections? The question is not what you have tried. Have you looked at the documentation for WMI?
F-ES Sitecore 9-Feb-16 5:59am    
You could have found the answer to this in seconds if you'd googled "c# get list of services". Please do basic research before asking a question.

1 solution

so, what you're actually saying, is, you've done SFA aka nada/zip/zilch except post the same request under 'What I have tried' - did you think about using Google perhaps ? here's 2 links that may help

ServiceController.GetServices Method (System.ServiceProcess)[^]

How to: Retrieve Lists of Services[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900