UriBuilder.ToString Method ()

 

Returns the display string for the specified UriBuilder instance.

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

override ToString : unit -> string

Return Value

Type: System.String

The string that contains the unescaped display string of the UriBuilder.

Exception Condition
UriFormatException
System_CAPS_noteNote

In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, FormatException, instead.

The UriBuilder instance has a bad password.

The display string contains the Port property value if the Port property was set or the port was specified when the UriBuilder was constructed using of the UriBuilder methods that accept a port number parameter except for the case when the Port.property value was set to a value of -1 to indicate the default port.

The display string does not contain the Port property value if the Port property was not set and a port was not specified when the UriBuilder was constructed. The display string also does not contain the Port property value if the Port property or port number for the constructor was set to a value of -1.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: