检测网络适配器的状态 [英] Detect status of network adapter

查看:117
本文介绍了检测网络适配器的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我需要快速检测网络适配器的状态.我使用了WMI类和事件,但是CPU的负载很高.您能给我一些解决这个问题的建议吗?可能有一些注册表项可以帮助我吗?对于我的应用程序,我使用Visual C#.

谢谢!

Hello!

I need quickly to detect status of network adapter. I used WMI classes and events, but loading of CPU is very high. Can you give me some advices to solve this problem. May be are there some registry keys which can help me? For my application i use Visual C#.

Thank you!

推荐答案

为什么注册表项会存储网络适配器的状态?您的身份是什么意思?如果您使用的是WMI,那么您将使用最佳的过程.也许您需要轮询它并存储值,以便可以快速获取它并假定它没有更改?
Why would a registry key store the status of a network adapter ? What do you mean by status ? If you''re using WMI, you''re using the best possible process. Perhaps you need to poll it and store the value so you can get it quickly and assume it''s not changed?


M8R-3d3rjt1写道:
M8R-3d3rjt1 wrote:

我的意思是我需要检测网络适配器何时变为联机或脱机.

I mean that i need detect when network adapter became OnLine or OffLine.



查看是否 [



See if this[^] helps. :)


我的意思是我需要检测网络适配器何时变为联机或脱机.
I mean that i need detect when network adapter became OnLine or OffLine.


这篇关于检测网络适配器的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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