GenericUriParser 类

定义

用于分层 URI 的可自定义分析器。A customizable parser for a hierarchical URI.

public ref class GenericUriParser : UriParser
public class GenericUriParser : UriParser
type GenericUriParser = class
    inherit UriParser
Public Class GenericUriParser
Inherits UriParser
继承
GenericUriParser

注解

如果要基于众所周知的方案创建分析器, 请使用HttpStyleUriParser GopherStyleUriParserFtpStyleUriParser LdapStyleUriParser、、或NewsStyleUriParserIf you want to create a parser based on a well-known scheme, use HttpStyleUriParser, FtpStyleUriParser, GopherStyleUriParser, LdapStyleUriParser, or NewsStyleUriParser.

创建可自定义的分析器时, 会通过将System.GenericUriParserOptions枚举中可用值的按位组合传递GenericUriParser给构造函数来指定分析器的行为。When creating a customizable parser, the behavior of the parser is specified by passing a bitwise combination of the values available in the System.GenericUriParserOptions enumeration to the GenericUriParser constructor.

已对System.Uri现有类进行扩展, 以提供对国际资源标识符 (IRI) 和国际化域名 (IDN) 的支持。The existing System.Uri class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names (IDN). 除非当前用户专门启用 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.

默认情况下, GenericUriParser从派生的所有分析程序都不会获得 IRI 和 IDN 支持。All parsers derived from GenericUriParser will not gain IRI and IDN support by default. Default选项不包括 IRI 和 IDN 支持。The Default option does not include IRI and IDN support. System.GenericUriParserOptions枚举添加了两个新值, 以指示自定义分析器是否支持 IRI 和 IDN。Two new values are added to the System.GenericUriParserOptions enumeration to indicate if a custom parser supports IRI and IDN.

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

构造函数

GenericUriParser(GenericUriParserOptions)

创建用于分层 URI 的可自定义分析器。Create a customizable parser for a hierarchical URI.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetComponents(Uri, UriComponents, UriFormat)

从 URI 获取各个组成部分。Gets the components from a URI.

(继承自 UriParser)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InitializeAndValidate(Uri, UriFormatException)

初始化分析器的状态并验证 URI。Initialize the state of the parser and validate the URI.

(继承自 UriParser)
IsBaseOf(Uri, Uri)

确定 baseUri 是否为 relativeUri 的基 URI。Determines whether baseUri is a base URI for relativeUri.

(继承自 UriParser)
IsWellFormedOriginalString(Uri)

指示 URI 是否是格式良好的。Indicates whether a URI is well-formed.

(继承自 UriParser)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnNewUri()

Uri 构造函数调用以获取一个 UriParser 实例。Invoked by a Uri constructor to get a UriParser instance.

(继承自 UriParser)
OnRegister(String, Int32)

在注册 UriParser 方法时由 Framework 调用。Invoked by the Framework when a UriParser method is registered.

(继承自 UriParser)
Resolve(Uri, Uri, UriFormatException)

Uri 构造函数和 TryCreate 调用以解析相对 URI。Called by Uri constructors and TryCreate to resolve a relative URI.

(继承自 UriParser)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于