UriParser.GetComponents(Uri, UriComponents, UriFormat) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从 URI 获取组件。
protected:
virtual System::String ^ GetComponents(Uri ^ uri, UriComponents components, UriFormat format);
C#
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
要从 uri
中检索的 UriComponents。
包含组件的字符串。
使用 GetComponents 方法确定 URI 的各个部分的值,例如 Scheme、Host或 Port。
组件按 URI 中显示的顺序返回。 例如,如果指定了 Scheme,则首先显示它。
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |