This information is supplied for understanding common uses and differences between Address Classes in .NET:

class IPAddress:

Has 1 Property: long Address {get,set}, for the IP It contains.
If wanting to get the IP Address it caontains as a dotted-quad format, Don't use the .Address property, and instead do
IP1.ToString(), where IP1 is an Object of the IPAddress class.

Examples of Use:
1: IPAddress IP1=IPAddress.Parse("");
2: IPAddress IP1=Dns.Resolve([0];



Has 2 Properties:
- IPAddress  Address    //An IP. Cannot contain a Hostname(like "")
- int              Port



Has 3 Properties(all are {get,set}):
- IPAddress[]   AddressList             //IP Addresses Associated with a Host
- string[]           Aliases                  //DNS Names That Resolve to the IP Addresses in the AddressList Property
- string             HostName              //The Primary HostName for the Server

This class is Used as a Helper Class With the Dns Class.
Example of Use:
IPHostEntry H=Dns.GetHostByName("");

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.