語言

UriParser.GetComponents(Uri, UriComponents, UriFormat) 方法

定義

從 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

參數

uri
Uri

解析 URI。

components
UriComponents

從 UriComponents 取回 uri。

format
UriFormat

UriFormat這是控制特殊字元如何逃逸的值之一。

傳回

包含元件的字串。

例外狀況

format 無效。

-或-

components 並非有效 UriComponents 數值的組合。

uri 需要使用者驅動的解析

-或-

uri 並非絕對的上呼吸道。 此方法無法使用相對 URI。

備註

使用此 GetComponents 方法來判定 URI 各部分的值,例如 Scheme、 Host、 Port或 。

元件會依照它們出現在 URI 中的順序回傳。 例如,若 Scheme 指定為 ,則該 先出現。

適用於

另請參閱