开发者

How could I get a broadcast address on given port?

How can I get a broadcast address for a g开发者_开发百科iven port in C#?

Is using something in NetworkInterface.GetAllNetworkInterfaces() the right way?

Thank you

Clarification: I'd like to get an array of all broadcast addresses. Then I'd add a given port and return IPEndPoint[].


I did it by getting IP address, subnet mask and then doing IP OR ~SUBNET on each byte.

broadcast[i] = (byte)(ip[i] | ~sub[i]);

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜