In C# how do I get the list of local computer names like what one gets viewing the Network in windows explorer In C# how do I get the list of local computer names like what one gets viewing the Network in windows explorer windows windows

In C# how do I get the list of local computer names like what one gets viewing the Network in windows explorer


You can try using the System.DirectoryServices namespace.

var root = new DirectoryEntry("WinNT:");foreach (var dom in root.Children) {    foreach (var entry in dom.Children) {        if (entry.Name != "Schema") {            Console.WriteLine(entry.Name);        }    }}


You need to broadcast an ARP request for all IPs within a given range. Start by defining the base IP on your network and then setting an upper identifier.

I was going to write up some code examples etc but it looks like someone has covered this comprehensively here;

Stackoverflow ARP question


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/)