UriParser.GetComponents(Uri, UriComponents, UriFormat) Método

Definição

Obtém os componentes de um URI.Gets the components from a URI.

protected:
 virtual System::String ^ GetComponents(Uri ^ uri, UriComponents components, UriFormat format);
protected virtual string GetComponents (Uri uri, UriComponents components, UriFormat format);
abstract member GetComponents : Uri * UriComponents * UriFormat -> string
override this.GetComponents : Uri * UriComponents * UriFormat -> string
Protected Overridable Function GetComponents (uri As Uri, components As UriComponents, format As UriFormat) As String

Parâmetros

uri
Uri

O URI a ser analisado.The URI to parse.

components
UriComponents

O UriComponents a ser recuperado de uri.The UriComponents to retrieve from uri.

format
UriFormat

Um dos valores UriFormat que controlam como escapar caracteres especiais.One of the UriFormat values that controls how special characters are escaped.

Retornos

String

Uma cadeia de caracteres que contém os componentes.A string that contains the components.

Exceções

uriFormat é inválido.uriFormat is invalid.

- ou --or- uriComponents não é uma combinação de valores UriComponents válidos.uriComponents is not a combination of valid UriComponents values.

uri exige uma análise controlada pelo usuáriouri requires user-driven parsing - ou --or- uri não é um URI absoluto.uri is not an absolute URI. Não é possível usar os URIs relativos com este método.Relative URIs cannot be used with this method.

Comentários

Use o GetComponents método para determinar o valor de várias partes do URI, como Scheme , Host ou Port .Use the GetComponents method to determine the value of various parts of the URI, such as the Scheme, Host, or Port.

Os componentes são retornados na ordem em que aparecem no URI.The components are returned in the order that they appear in the URI. Por exemplo, se Scheme for especificado, ele aparecerá primeiro.For example, if Scheme is specified, it appears first.

Aplica-se a

Confira também