如何在system.msc中检索系统中的服务 [英] How to retrieve services in system in system.msc

查看:77
本文介绍了如何在system.msc中检索系统中的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



Hi All,

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.





我如何使用ADO.Net(Winforms)在C#中实现这一点。以下是我从链接中得到的代码格式:



如何在C#中创建和使用Windows服务 [ ^ ]



我可以打开服务,但无法在我的应用程序中显示服务状态。任何人都可以建议我替代方案吗?



我尝试过:



我在描述问题时尝试了上面提到的代码。使用该代码,我可以打开服务,但无法显示服务的状态。



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.

推荐答案

所以,你实际上说的是,你已经完成了SFA aka nada / zip / zilch除了在'我尝试过的'下发布相同的请求之外 - 您是否考虑过使用Google?这里有2个可能有用的链接



ServiceController.GetServices方法(System.ServiceProcess) [ ^ ]



如何:检索服务列表 [ ^ ]
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[^]


这篇关于如何在system.msc中检索系统中的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆