I want to find all devices on my local network using c#.
The solutions that have at the moment is based on pinging each ip on my local network. something that explained here:
How to Perform Multiple "Pings" in Parallel using C#
The problem is that if I have more than one network interface on my PC (for example one wifi and one Ethernet) how can I understand which one should I ping? How to find suitable address range for each network? and so on. If the subnet mask is very big (for example when subnet is 255.255.0.0, it would takes a lot of time to do this.
There are some other suggested solution such as this:
Locating computer on subnet/network
But how can I ping the broadcast address and find who is answering? Ping in C# only return one result for one IP (Am I right)?
Is there any better solution?