我们可以从C#检查计算机上托管的服务吗? [英] Can we check services hosted on machine from C#?

查看:73
本文介绍了我们可以从C#检查计算机上托管的服务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我满足以下要求,

->自动执行Windows事件,该事件获取服务器名称,并检查服务器的活动性以及该服务器上托管的服务,包括服务的活动性

这需要在任何.NET平台上由C#完成.
请帮我解决需求.

我已完成以下代码,

->获取服务器名称并检查其活动性

在此先感谢您.

Hi,

I met with following requirement,

->Automated windows event which takes server names, and check that server activeness along with that services hosted on that server including services activeness

This needs to be completed by C# on any .NET platform.
Please help me top solve the requirement.

I have completed following piece of code,

->Getting server name and checking its activeness

Thanks in advance.

推荐答案

您的关键字是WMI.您可以从此处开始: http://www.geekpedia.com/tutorial225_Listing-Services-with-Csharp.html [ ^ ],以及您可以将其扩展为访问远程计算机(请参见创建远程计算机在C#中使用WMI的过程 [ ^ ]).
Your keyword is WMI. You can start here: http://www.geekpedia.com/tutorial225_Listing-Services-with-Csharp.html[^], and than you can extend it to access remote machines (see Create a Remote Process using WMI in C#[^] for example).


这篇关于我们可以从C#检查计算机上托管的服务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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