本文介绍了使用System.Net.NetworkInformation,有没有一个ping绑定到特定接口的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然Ping.Send()简单易懂,我似乎无法弄清楚如何Ping.Send()了我选择的接口。特别是我的WLAN接口或我的以太网接口时,两者都连接到单独的网络。

Although the Ping.Send() is easy and straightforward, I can't seem to figure out how to Ping.Send() out of the interface I choose. specifically my WLAN interface or my Ethernet interface when both are connected to separate networks.

我将不得不使用套接字命名空间和绑定(localEndpoint)?

Would I have to use the Sockets namespace and the Bind(localEndpoint)?

这似乎有点奇怪,即绑定功能是不是在NetworkInformation.Ping工具可用。或者是与放大器;我只是无法找到它?

It seems odd that that binding functionality isn't available in the NetworkInformation.Ping utility. Or is it & I just can't find it?

感谢您

推荐答案

ICMP没有插座为主。该平将被发送到基于所述路由表中的相应的端口

ICMP is not socket based. The ping will be sent to the appropriate port based on the routing table.

这篇关于使用System.Net.NetworkInformation,有没有一个ping绑定到特定接口的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 05:20