UriBuilder.ToString Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns the display string for the specified UriBuilder instance.

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

Syntax

'Declaration
Public Overrides Function ToString As String
public override string ToString()

Return Value

Type: System.String
The string that contains the unescaped display string of the UriBuilder.

Exceptions

Exception Condition
UriFormatException

The URI constructed by the UriBuilder properties has a bad username and password (the UserName property is null or an empty string, but the Password property is not empty.

Remarks

The display string always contains the Port property value, even if it is the default port for the Scheme. The string returned by the Uri.ToString method only contains the port if it is not the default port for the scheme.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference