Export (0) Print
Expand All

IPAddress.Address Property

NOTE: This member is now obsolete.
IPAddress.Address is address family dependant, use Equals method for comparison.

An Internet Protocol (IP) address.

[Visual Basic]
<Obsolete("IPAddress.Address is address family dependant, use _
   Equals method for comparison.", False)>
Public Property Address As Long
[C#]
[Obsolete("IPAddress.Address is address family dependant, use
   Equals method for comparison.", false)]
public long Address {get; set;}
[C++]
[Obsolete("IPAddress.Address is address family dependant, use
   Equals method for comparison.", false)]
public: __property __int64 get_Address();
public: __property void set_Address(__int64);
[JScript]
public
   Obsolete("IPAddress.Address is address family dependant, use Equals
   method for comparison.", false)
function get Address() : long;
public function set Address(long);

Property Value

The long value of the IP address.

Remarks

This property is obsolete. Use GetAddressBytes.

To convert Address to dotted-quad notation, use the ToString method.

Example

[Visual Basic, C#, C++] The following example uses the Address parameter to retrieve the ip Address of the IPAddress instance.

[Visual Basic] 

    Public Sub PrintAddress(IpAddressString As [String])
        ' Creates an instance of the IPAddress' for the specified IP string in dotted-quad notation.
        Dim hostIPAddress As IPAddress = IPAddress.Parse(IpAddressString)
        Console.WriteLine(ControlChars.Cr + "The IP address '" + IpAddressString + "' is {0}", hostIPAddress.ToString())
    End Sub 'PrintAddressFamily


[C#] 
public void PrintAddress(String IpAddressString)
{
  // Creates an instance of the IPAddress for the specified IP string in 
  // dotted-quad notation. 
  IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
  Console.WriteLine("\nThe IP address '" + IpAddressString + "' is {0}", hostIPAddress.ToString()); 
}

[C++] 
void PrintAddress(String* IpAddressString) {
   // Creates an instance of the IPAddress for the specified IP String* in
   // dotted-quad notation.
   IPAddress* hostIPAddress = IPAddress::Parse(IpAddressString);
   Console::WriteLine(S"\nInteger value of IP address {0} is {1}", IpAddressString, __box( hostIPAddress->Address));
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IPAddress Class | IPAddress Members | System.Net Namespace

Show:
© 2014 Microsoft