There are a lot of questions about getting the name and IP addresses of the local machine and several about getting IP addresses of other machines on the LAN (not all answer
This seems to be what you are after: How get list of local network computers?
In C#: you can use Gong Solutions Shell Library (https://sourceforge.net/projects/gong-shell/)