C#:IP地址更改通知 [英] C# : IP address changed notification

查看:160
本文介绍了C#:IP地址更改通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道C#中是否存在用于特定网络接口的IP地址更改的通知机制.

我知道NetworkChange.NetworkAddressChanged可用于检测IP更改,但是我正在寻找诸如IPv4/IPv6,DNS和网关IP更改通知之类的详细信息.

感谢您的帮助.

Hi All,

I would like to know if there is a notification mechanism in C# for IP address change for a particular network interface.

I know that NetworkChange.NetworkAddressChanged can be made use to detect in IP change but I am looking for micro details like IPv4/IPv6, DNS and gateway IP change notifications.

Thanks for the help.

推荐答案

我认为您无法通过NetworkAddressChanged事件获得此详细信息.
当您的程序启动时以及收到NetworkAddressChanged事件时,获取所有详细信息该怎么办,再次获取所有详细信息,然后进行比较以查找发生了什么变化.
I do not think you can get this detailed info on a NetworkAddressChanged event.
What about get all the detailed when your program starts and when you receive NetworkAddressChanged event, get all the detailed again and then compare to find what has changed.


这篇关于C#:IP地址更改通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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