AnyUri.GetComponents MethodAnyUri.GetComponents MethodAnyUri::GetComponents Method
Syntax
Public Function GetComponents( _ components As UriComponents, _ format As UriFormat _ ) As String
public string GetComponents( UriComponents components, UriFormat format )
public: String^ GetComponents( UriComponents components, UriFormat format )
Parameters
- components
Type: System.UriComponentsSystem.UriComponentsSystem::UriComponents
A bitwise combination of the UriComponentsUriComponentsUriComponents values that specifies which parts of the current instance to return.
- format
Type: System.UriFormatSystem.UriFormatSystem::UriFormat
One of the UriFormatUriFormatUriFormat values that controls how special characters are escaped.
Return Value
Exceptions
Exception | Condition |
ArgumentOutOfRangeExceptionArgumentOutOfRangeExceptionArgumentOutOfRangeException | components is not a combination of valid UriComponentsUriComponentsUriComponents values or format is not one of the UriFormatUriFormatUriFormat values. The AbsoluteUriAbsoluteUriAbsoluteUri value will not necessarily return an absolute URI, but will contain all the components that are present in the current instance. |
Remarks
Unlike GetComponentsGetComponentsGetComponents, relative URIs can be used with this method. In this case only the components that are present in the URI are returned. The KeepDelimiterKeepDelimiterKeepDelimiter and SerializationInfoStringSerializationInfoStringSerializationInfoString are ignored.
The components returned are normalized as follows:
- Case normalization of URI scheme, and percent-encoded values.
- Omission of default ports for some schemes (eg. port 21 for the
ftp:
scheme). - Resolution of dot-segments (
..
and.
path segments). - Normalization of '/' and '\' characters in
file:
paths residing onlocalhost
.
Other than the set of characters that are escaped, this method behaves like the GetComponentsGetComponentsGetComponents method with the