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

Solution 1:

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);
        }
    }
}

Solution 2:

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