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á se UriComponents z uri.

format
UriFormat

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

Návraty

Řetězec, který obsahuje komponenty.

Výjimky

format je neplatný.

nebo

components 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 s touto metodou použít.

Poznámky

Použijte metodu GetComponents k určení hodnoty různých částí identifikátoru URI, například Scheme, Hostnebo Port.

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é