如何从Windows应用程序检测禁用的网络接口连接? [英] How do I detect a disabled Network Interface Connection from a Windows application?

查看:52
本文介绍了如何从Windows应用程序检测禁用的网络接口连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道什么时候接口被禁用了.

I would like to know when a interface has been disabled.

如果我进入Windows管理器并禁用2个启用的连接之一,则GetIfTable()仅返回大约1个接口的状态,它不再看到断开的接口.(返回1张桌子)

If I go into the windows manager and disable one of the 2 enabled connections, GetIfTable() only returns status about 1 interface, it no longer sees the disconnected one. (Returns 1 table)

如何获得返回的消息,表明已禁用的接口仍然存在,但当前已被禁用?

How can I get something to return that the disabled interface still exists but is currently disabled?

谢谢.

http://msdn.microsoft.com/zh-cn/library/aa365943%28VS.85%29.aspx

推荐答案

我认为您只需要阅读注册表即可.

I think you would just need to read the registry.

例如,这是在网络上找到的摘要片段,内容如下:

For example, this is a snippet found on the web of what things should look like:

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{1E6AF554-25FF-40FC-9CEE-EB899472C5A3}\Connection]
"PnpInstanceID"="PCI\\VEN_14E4&DEV_1696&SUBSYS_12BC103C&REV_03\\4&3A321F38&0&10F0"
"MediaSubType"=dword:00000001
"Name"="Lan Name"
"ShowIcon"=dword:00000000
"IpCheckingEnabled"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{1E6AF554-25FF-40FC-9CEE-EB899472C5A3}\Connection]
"PnpInstanceID"="PCI\\VEN_14E4&DEV_1696&SUBSYS_12BC103C&REV_03\\4&3A321F38&0&10F0"
"MediaSubType"=dword:00000001
"Name"="Lan Name"
"ShowIcon"=dword:00000000
"IpCheckingEnabled"=dword:00000001

这篇关于如何从Windows应用程序检测禁用的网络接口连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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