Reputation: 471
I'm trying to get an IP address from computer name in same network... Something like CMD command "nbtstat -a COMPNAME" in C# windows application
Upvotes: 3
Views: 6954
Reputation: 18563
Use Dns.GetHostAddresses
:
Dns.GetHostAddresses("some pc name")
.ToList()
.ForEach(a => Console.WriteLine(a.ToString()));
Upvotes: 12
Reputation: 54268
Try this method:
Dns.GetHostName();
http://msdn.microsoft.com/en-us/library/system.net.dns.gethostname.aspx
Upvotes: -1