开发者

using System.Net.NetworkInformation, is there a way to bind a ping to a specific interface?

开发者 https://www.devze.com 2023-01-12 01:59 出处:网络
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开发者_StackO

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开发者_StackOverflow中文版 when both are connected to separate networks.

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

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

Thank you


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

0

精彩评论

暂无评论...
验证码 换一张
取 消