如何监控以太网连接状态

发布于 2024-09-27 14:30:04 字数 337 浏览 0 评论 0 原文

如何监控给定以太网连接的 .NET 以太网电缆是否已插入?

我想枚举所有以太网连接并订阅任何连接状态更改。我对检测互联网访问不感兴趣,只有当以太网连接已连接未连接时。

更新:我发现这篇博文介绍了如何使用 WMI 查询来获取断开连接通知。

How can I monitor if Ethernet cables are plugged in or not from .NET for a given Ethernet connection?

I would like to enumerate all Ethernet connections and subscribe to any connection status changes. I am not interested in detecting Internet access, only if an Ethernet connection is Connected or Not Connected.

Update: I found this blog post on how to use a WMI query to be notified of disconnections.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫相离 2024-10-04 14:30:04

查看 Win32_NetworkAdapter 类。

Look at the NetConnectionStatus property of the Win32_NetworkAdapter class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文