检测何时拔下网线 [英] Detect When Network Cable Unplugged

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

问题描述

Windows 知道您何时从 NIC 上拔掉了网线.有没有一种编程方式可以通过 C++ 中的 API 来确定这一点?

注意:我没有使用 .NET,这是用于封闭 LAN(从未连接到 Internet)

解决方案

Raymond Chen 博客 最近关于类似的事情.这是相关的文档.我认为 MIB_IPADDR_DISCONNECTED 标志正是您要找的.

Windows knows when you have removed the network cable from your NIC. Is there a programmatic way to determine this via API in C++?

Note: I am not using .NET and this is for a closed LAN (not connected to Internet ever)

解决方案

Raymond Chen blogged about something similar recently. Here is the relevant documentation. I think the MIB_IPADDR_DISCONNECTED flag is what you are looking for.

这篇关于检测何时拔下网线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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