How to make broadcasting in C#

Hi all,
I need to know how to make broadcasting in LAN network to know how many host are connected to it.

Is it the right way, or I have to do something else.

Regards...

[178 byte] By [Wasim] at [2007-12-16]
# 1
You can try this link on broadcasting with UDP.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconusingudpservices.asp

But what you need is using broadcasting with ICMP. Try understanding what broadcasting is with that link above.

For ICMP, you'll need to send a "PING" to the broadcast IP. Here's a few source codes to write your own PING program.

http://www.dataidee.com/ping/ping.htm

http://www.csharphelp.com/archives/archive6.html

http://www.c-sharpcorner.com/network/ping.asp

If you're using .NET Framework 2.0, there's a Ping utility class at the namespace System.Net.NetworkInformation which you can use. There is also an ICMP class available.

I hope that helps.

JustinLee at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# Language...