IPAddress AddressFamily : IP Address : Network C# Source Code


Custom Search

C# Source Code » Network » IP Address »

 

IPAddress AddressFamily








    
 
using System;
using System.Net;
class MainClass {
    public static void Main(string[] args) {
        foreach (string comp in args) {
            try {
                IPAddress[] addresses = Dns.GetHostEntry(comp).AddressList;
                foreach (IPAddress address in addresses) {
                    Console.WriteLine("{0} = {1} ({2})",
                        comp, address, address.AddressFamily);
                }
            } catch (Exception ex) {
                Console.WriteLine("{0} = Error ({1})", comp, ex.Message);
            }
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» IP Address