GenericUriParser GenericUriParser GenericUriParser GenericUriParser Class

定义

用于分层 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
继承
GenericUriParserGenericUriParserGenericUriParserGenericUriParser

注解

如果你想要创建一个分析器基于已知的方案,请使用HttpStyleUriParserFtpStyleUriParserGopherStyleUriParserLdapStyleUriParser,或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) GenericUriParser(GenericUriParserOptions) GenericUriParser(GenericUriParserOptions) GenericUriParser(GenericUriParserOptions)

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetComponents(Uri, UriComponents, UriFormat) GetComponents(Uri, UriComponents, UriFormat) GetComponents(Uri, UriComponents, UriFormat) GetComponents(Uri, UriComponents, UriFormat)

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

(Inherited from UriParser)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InitializeAndValidate(Uri, UriFormatException) InitializeAndValidate(Uri, UriFormatException) InitializeAndValidate(Uri, UriFormatException) InitializeAndValidate(Uri, UriFormatException)

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

(Inherited from UriParser)
IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri)

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

(Inherited from UriParser)
IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri)

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

(Inherited from UriParser)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
OnNewUri() OnNewUri() OnNewUri() OnNewUri()

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

(Inherited from UriParser)
OnRegister(String, Int32) OnRegister(String, Int32) OnRegister(String, Int32) OnRegister(String, Int32)

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

(Inherited from UriParser)
Resolve(Uri, Uri, UriFormatException) Resolve(Uri, Uri, UriFormatException) Resolve(Uri, Uri, UriFormatException) Resolve(Uri, Uri, UriFormatException)

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

(Inherited from UriParser)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于