views:

78

answers:

1

How can I send a multicast ping in .NET ? So that all computers on the network respond ?

+4  A: 

Assuming you mean "broadcast ping" (I get the two confused All The Time, myself):
Fetch the local network gateway IP, change the last byte to 255, ping that IP.

The main problem with your approach though is that the set of all devices on the network that will respond to a broadcast ping is typically much smaller than the set of all devices on the network. I've found that while most devices will respond to a direct ping, very few will respond to a broadcast ping. It's implementation dependant.

Task
Damn, no response at all with 3 computers on the network.
Quandary
Yes, I believe that a modern Windows operating system will detect but never respond to a broadcast ping. I believe that Microsoft decided it was a security risk. You're going to have to ping each machine individually if you want a reliable implementation.
Task