using System.Net.NetworkInformation, is there a wa

2019-02-19 11:00发布

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.

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

标签: c# networking
1条回答
叼着烟拽天下
2楼-- · 2019-02-19 11:30

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

查看更多
登录 后发表回答