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)

new : 
        uri:string -> UriBuilder

Parameters

uri
Type: System.String

A URI string.

Exception Condition
ArgumentNullException

uri is null.

UriFormatException
System_CAPS_noteNote

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

uri is a zero length string or contains only spaces.

-or-

The parsing routine detected a scheme in an invalid form.

-or-

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

-or-

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 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:
© 2016 Microsoft