IPAddress.ToString Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Converts an Internet address to its standard notation.

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

override ToString : unit -> string

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