UriBuilder.ToString Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns the display string for the specified UriBuilder instance.
Assembly: System (in System.dll)
Return Value
Type: System.StringThe string that contains the unescaped display string of the UriBuilder.
| 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. |
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.