Get Host By Name, Get Host Name : IP Address « Network « C# / C Sharp
- C# / C Sharp
- Network
- IP Address
Get Host By Name, Get Host Name
using System;
using System.Net;
class AddressSample {
public static void Main() {
IPHostEntry ihe = Dns.GetHostByName(Dns.GetHostName());
IPAddress myself = ihe.AddressList[0];
Console.WriteLine("The NONE address is: {0}",myself);
}
}
Related examples in the same category