System.UriParser.GetComponents Method

Gets the components from a URI.

Syntax

protected virtual string GetComponents (Uri uri, UriComponents components, UriFormat format)

Parameters

uri
The URI to parse.
components
The UriComponents to retrieve from uri.
format
One of the UriFormat values that controls how special characters are escaped.

Returns

A string that contains the components.

Remarks

Use the UriParser.GetComponents(Uri, UriComponents, UriFormat) method to determine the value of various parts of the URI, such as the UriComponents.Scheme, UriComponents.Host, or UriComponents.Port.

The components are returned in the order that they appear in the URI. For example, if UriComponents.Scheme is specified, it appears first.

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0