问题描述
我使用vs2008,winxp,在LAN网络与Win2003服务器。
我想要一个应用程序安装在winxp检测win2003机器是否在线或离线,如果离线。
我有这个引用,任何更多的引用,代码示例和最佳实践。
对于.NET System.Net.NetworkInformation.Ping
,因为它是非常灵活,你有可能做异步,我发现它比WMI更直观(我有使用这两个和使用WMI只有当我需要从远程机器获取更多的信息,而不仅仅是ping)。但这只是个人意见。
I use vs2008, winxp, in LAN network with Win2003 servers.
I want a application installed in winxp for detect if win2003 machines is online or offline , and if offline when boot it.
I have this references, any more references, code samples and best practices ??
http://danielvl.blogspot.com/2004/06/how-to-ping-in-c-using.html
http://snipplr.com/view/2157/ping-using-wmi-pingstatus/
http://dotnoted.wordpress.com/2005/01/15/the-popular-c-ping-utitility/
I would go for the .NET System.Net.NetworkInformation.Ping
, because it is quite flexible, you have the possibility of doing it asynchronously and I find it more intuitive than WMI (I have used both and use WMI only if I need to get more info from the remote machine than just the ping). But this is just a personal opinion.
这篇关于使用WMI和C#检测机器是否联机或脱机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!