public static void Main(string[] args)
Console.Write("Continue with main thread");
private static void LookupHostName()
object unrelatedObject = "hello";
Dns.BeginGetHostAddresses("microsoft.com", OnHostNameResolved, unrelatedObject);
private static void OnHostNameResolved(IAsyncResult ar)
object unrelatedObject = ar.AsyncState;
IPAddress[] addresses = Dns.EndGetHostAddresses(ar);
foreach (var ip in addresses)
Console.WriteLine("{0}",ip.Address);