ToString Method

IPAddress.ToString Method ()


Converts an Internet address to its standard notation.

Namespace:   System.Net
Assembly:  System (in System.dll)

public override string ToString()

Return Value

Type: System.String

A string that contains the IP address in either IPv4 dotted-quad or in IPv6 colon-hexadecimal notation.

Exception Condition

The address family is InterNetworkV6 and the address is bad.

The ToString method converts the IP address that is stored in the Address property to either IPv4 dotted-quad or IPv6 colon-hexadecimal notation.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top
© 2015 Microsoft