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)


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.


Exception Condition

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.


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


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


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

See Also