UriBuilder Constructor (String)

UriBuilder Constructor (String)


Initializes a new instance of the UriBuilder class with the specified URI.

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

public UriBuilder(
	string uri


Type: System.String

A URI string.

Exception Condition

uri is null.


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

uri is a zero length string or contains only spaces.


The parsing routine detected a scheme in an invalid form.


The parser detected more than two consecutive slashes in a URI that does not use the "file" scheme.


uri is not a valid URI.

This constructor initializes a new instance of the UriBuilder class with the Fragment, Host, Path, Port, Query, Scheme, and Uri properties set as specified in uri.

If uri does not specify a scheme, the scheme defaults to "http:".

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