UriFormat 枚举


控制 URI 信息的转义方式。Controls how URI information is escaped.

public enum class UriFormat
public enum UriFormat
type UriFormat = 
Public Enum UriFormat


SafeUnescaped 3

在请求的 URI 组成部分中具有保留意义的字符将仍然进行转义。Characters that have a reserved meaning in the requested URI components remain escaped. 所有其他字符不进行转义。All others are not escaped.

Unescaped 2

未执行任何转义。No escaping is performed.

UriEscaped 1

根据 RFC 2396 中的规则执行转义。Escaping is performed according to the rules in RFC 2396.


此枚举由 GetComponents 方法用来指定返回的 URI 中的字符转义级别。This enumeration is used by the GetComponents method to specify the level of character escaping in the returned URI.

RFC 2396 定义了 Uri 的标准转义,可从获取 https://rfc-editor.orgRFC 2396 defines the standard escaping for URIs, and is available at https://rfc-editor.org.

如果字符在请求的中具有保留含义,SafeUnescaped 会将以下字符保留为转义 UriComponents : "%"、"#"、"?"、"/"、" \ " 和 "@"。</span><span class="sxs-lookup">SafeUnescaped leaves the following characters escaped if the character has a reserved meaning in the requested UriComponents: "%", "#", "?", "/", "\", and "@".