检测何时拔下网线

2021-12-20 00:00:00 networking windows-xp c++

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.

相关文章