Share via


HostString.ToUriComponent 方法

定义

返回具有正确格式和编码且可在 HTTP 标头的 URI 中使用的值。 任何 Unicode 都将转换为 punycode。 将为 IPv6 地址添加括号(如果没有括号)。

public:
 System::String ^ ToUriComponent();
public string ToUriComponent ();
member this.ToUriComponent : unit -> string
Public Function ToUriComponent () As String

返回

HostString格式化为在 URI 或 HTTP 标头中使用的值。

适用于