UriParser.GetComponents(Uri, UriComponents, UriFormat) Metoda

Definice

Získá komponenty z identifikátoru 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

Parametry

uri
Uri

Identifikátor URI, který se má analyzovat.

components
UriComponents

Načítá UriComponents se z uri.

format
UriFormat

Jedna z UriFormat hodnot, které řídí, jak jsou speciální znaky řídicí.

Návraty

String

Řetězec, který obsahuje komponenty.

Výjimky

Formát uriFormat je neplatný.

-nebo- uriComponents není kombinací platných UriComponents hodnot.

uri vyžaduje analýzu řízenou uživatelem. -nebo- uri není absolutní identifikátor URI. Relativní identifikátory URI nelze použít s touto metodou.

Poznámky

Použijte metodu GetComponents k určení hodnoty různých částí identifikátoru URI, jako Schemeje například , nebo HostPort.

Komponenty se vrátí v pořadí, v jakém se zobrazují v identifikátoru URI. Pokud je například zadán, Scheme zobrazí se jako první.

Platí pro

Viz také