Uri Constructor (String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

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

public Uri(
	string uriString
)

Parameters

uriString
Type: System..::..String
A URI.

This constructor creates a Uri instance from a URI string. It parses the URI, puts it in canonical format, and makes any required escape encodings.

This constructor does not ensure that the Uri refers to an accessible resource.

This constructor assumes that the string parameter references an absolute URI and is equivalent to calling the Uri constructor with UriKind set to Absolute. If the string parameter passed to the constructor is a relative URI, this constructor will throw a UriFormatException.

Show: