Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.NetworkInformation;
  4.  
  5. class HelloWorld {
  6.     static void Main() {
  7.       IPHostEntry data = Dns.GetHostByName("google.com");
  8.  
  9.       Console.WriteLine("Host: {0}", data.HostName);
  10.  
  11.       for(int item=0; item < data.AddressList.Length - 1; item++)
  12.       {
  13.         Console.WriteLine("Associated Address: {0}", data.AddressList[item]);
  14.       }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement