Detect When Network Cable Unplugged

前端 未结 2 1689
面向向阳花
面向向阳花 2020-12-03 03:30

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

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 03:42

    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.

提交回复
热议问题