GenericUriParserOptions Enum


指定 UriParser 的选项。Specifies options for a UriParser.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

public enum class GenericUriParserOptions
public enum GenericUriParserOptions
type GenericUriParserOptions = 
Public Enum GenericUriParserOptions


AllowEmptyAuthority 2

此分析器允许没有证书颁发机构的 URI。The parser allows a URI with no authority.

Default 0

分析器:需要授权;将反斜杠转换为正斜杠;反转义路径点、正斜杠和反斜杠;并删除末尾的点、空段和只包含点的段。The parser: requires an authority; converts backslashes into forward slashes; unescapes path dots, forward slashes, and back slashes; and removes trailing dots, empty segments, and dots-only segments.

DontCompressPath 128

此分析器不对 URI 进行规范化。The parser does not canonicalize the URI.

DontConvertPathBackslashes 64

此分析器不将反斜杠转换为正斜杠。The parser does not convert back slashes into forward slashes.

DontUnescapePathDotsAndSlashes 256

此分析器不对路径点、正斜杠或反斜杠进行转义还原。The parser does not unescape path dots, forward slashes, or back slashes.

GenericAuthority 1

此分析器允许基于注册表的证书颁发机构。The parser allows a registry-based authority.

Idn 512

分析器支持对主机名进行国际化域名 (IDN) 语法分析。The parser supports Internationalized Domain Name (IDN) parsing (IDN) of host names. 是否使用 IDN 由配置值指定。Whether IDN is used is dictated by configuration values.

IriParsing 1024

分析器支持 RFC 3987 中指定的国际资源标识符 (IRI) 语法分析规则。The parser supports the parsing rules specified in RFC 3987 for International Resource Identifiers (IRI). 是否使用 IRI 由配置值指定。Whether IRI is used is dictated by configuration values.

NoFragment 32

此方案不定义段部分。The scheme does not define a fragment part.

NoPort 8

此方案不定义端口。The scheme does not define a port.

NoQuery 16

此方案不定义查询部分。The scheme does not define a query part.

NoUserInfo 4

此方案不定义用户信息部分。The scheme does not define a user information part.


可以通过将选项作为参数传递给 GenericUriParser.GenericUriParser(GenericUriParserOptions) 构造函数来组合这些选项中的任何一个以配置通用 URI 分析器。You can combine any of these options to configure a generic URI parser by passing the options as a parameter to the GenericUriParser.GenericUriParser(GenericUriParserOptions) constructor.

现有的 System.Uri 类已扩展为基于 RFC 3987 提供对国际资源标识符(IRI)的支持。The existing System.Uri class has been extended to provide support for International Resource Identifiers (IRI) based on RFC 3987. 除非当前用户专门启用 IRI,否则他们看不到任何 NET Framework 2.0 行为的改变。Current users will not see any change from the .NET Framework 2.0 behavior unless they specifically enable IRI. 这确保了 NET Framework 以前版本的应用程序兼容性。This ensures application compatibility with prior versions of the .NET Framework.

System.Configuration.IdnElement 的配置设置由控制 System.Uri 类中的 IRI 处理的 System.Configuration.IriParsingElement 配置设置间接控制。The configuration setting for the System.Configuration.IdnElement is indirectly controlled by the System.Configuration.IriParsingElement configuration setting that controls IRI processing in the System.Uri class. 必须启用 IRI 处理才能进行 IDN 处理。IRI processing must be enabled for IDN processing to be possible. 如果禁用 IRI,IDN 处理将被设置为默认值,这时 NET Framework 2.0 行为用于兼容性,并且 IDN 名称不可用。If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.

国际化域名(IDN)属性仅控制 IDN 处理。The Internationalized Domain Name (IDN) attribute only controls IDN processing. 默认情况下,将执行其他所有 IRI 处理(例如,字符规范化)。All other IRI processing (character normalization, for example) is performed by default.

有关 IRI 支持的详细信息,请参阅 System.Uri 类的 "备注" 部分。For more information on IRI support, see the Remarks section for the System.Uri class.

Applies to

See also