UriParser UriParser UriParser UriParser Class

定义

分析新的 URI 方案。Parses a new URI scheme. 这是一个抽象类。This is an abstract class.

public ref class UriParser abstract
public abstract class UriParser
type UriParser = class
Public MustInherit Class UriParser
继承
UriParserUriParserUriParserUriParser
派生

注解

UriParser 类使你能够为新的 URI 方案创建分析器。The UriParser class enables you to create parsers for new URI schemes. 可以完整编写这些分析器,也可以从已知的方案(HTTP、FTP 和基于网络协议的其他方案)派生分析程序。You can write these parsers in their entirety, or the parsers can be derived from well-known schemes (HTTP, FTP, and other schemes based on network protocols). 如果要创建全新的分析器,请从GenericUriParser继承。If you want to create a completely new parser, inherit from GenericUriParser. 如果要创建扩展已知 URI 方案的分析器,请从FtpStyleUriParser FileStyleUriParserHttpStyleUriParser、、 GopherStyleUriParserLdapStyleUriParser继承。If you want to create a parser that extends a well-known URI scheme, inherit from FtpStyleUriParser, HttpStyleUriParser, FileStyleUriParser, GopherStyleUriParser, or LdapStyleUriParser.

Microsoft 强烈建议使用随 .NET 提供的分析器。Microsoft strongly recommends that you use a parser shipped with .NET. 构建自己的分析器会增加应用程序的复杂性,并且不会执行以及附带的分析器。Building your own parser increases the complexity of your application, and will not perform as well as the shipped parsers.

构造函数

UriParser() UriParser() UriParser() UriParser()

构建默认的 URI 分析器。Constructs a default URI parser.

方法

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.

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.

IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri) IsBaseOf(Uri, Uri)

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

IsKnownScheme(String) IsKnownScheme(String) IsKnownScheme(String) IsKnownScheme(String)

指示某个方案的分析器是否已注册。Indicates whether the parser for a scheme is registered.

IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri) IsWellFormedOriginalString(Uri)

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

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

OnRegister(String, Int32) OnRegister(String, Int32) OnRegister(String, Int32) OnRegister(String, Int32)

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

Register(UriParser, String, Int32) Register(UriParser, String, Int32) Register(UriParser, String, Int32) Register(UriParser, String, Int32)

将方案和端口号与 UriParser 关联。Associates a scheme and port number with a 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.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)

适用于