Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Computer Names of a Lan in C#

I want to create a chat application in which there is a ComboBx. I want to fill it with all the computer names in a network. How can I accomplish this in C#?

like image 277
Durga Dutt Avatar asked May 29 '11 16:05

Durga Dutt


People also ask

How do I find my LAN computer name?

Click Start, right-click Computer, and then click Properties. The computer name appears under Computer name, domain, and workgroup settings.

How do I find the computer name from an IP address on a LAN?

Click the Windows Start button, then "All Programs" and "Accessories." Right-click on "Command Prompt" and choose "Run as Administrator." Type "nslookup %ipaddress%" in the black box that appears on the screen, substituting %ipaddress% with the IP address for which you want to find the hostname.


1 Answers

The best option for discovering other computers in a LAN running the same application is probably mDNS.

Have a look at the Bonjour SDK for Windows which comes with a COM library usable from C# and sample code.

like image 105
dtb Avatar answered Sep 22 '22 15:09

dtb