System.GenericUriParser 类

方法描述

用于分层 URI 的可自定义分析器。

语法定义(C# System.GenericUriParser 类 的用法)

public class GenericUriParser : UriParser

构造函数

构造函数名称 构造函数描述
GenericUriParser 创建用于分层 URI 的可自定义分析器。

成员/方法

方法名称 方法描述
Equals(Object) 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。)
Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
GetComponents 从 URI 获取各个组成部分。 (继承自 UriParser。)
GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
GetType 获取当前实例的 Type。 (继承自 Object。)
InitializeAndValidate 初始化分析器的状态并验证 URI。 (继承自 UriParser。)
IsBaseOf 确定 baseUri 是否为 relativeUri 的基 URI。 (继承自 UriParser。)
IsWellFormedOriginalString 指示 URI 是否是格式良好的。 (继承自 UriParser。)
MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
OnNewUri 由 Uri 构造函数调用以获取一个 UriParser 实例。 (继承自 UriParser。)
OnRegister 在注册 UriParser 方法时由 Framework 调用。 (继承自 UriParser。)
Resolve 由 Uri 构造函数和 Uri.TryCreate() 调用以解析相对 URI。 (继承自 UriParser。)
ToString 返回表示当前对象的字符串。 (继承自 Object。)

提示和注释

如果要创建基于已知方案的分析器,请使用 HttpStyleUriParser、FtpStyleUriParser、GopherStyleUriParser、LdapStyleUriParser 或 NewsStyleUriParser。

在创建可自定义的分析器时,通过向 GenericUriParser 构造函数传递 System.GenericUriParserOptions 枚举中提供的值的按位组合,可以指定分析器的行为。

现有的 System.Uri 类已经进行了扩展,以便提供国际资源标识符 (IRI) 和国际化域名 (IDN) 支持。 除非特地启用了 IRI,否则当前用户不会看到 .NET Framework 2.0 的行为发生任何变化。 这确保了应用程序与以前版本的 .NET Framework 的兼容性。

默认情况下,派生自 GenericUriParser 的所有分析器都不会获得 IRI 和 IDN 支持。 Default 选项不包括 IRI 和 IDN 支持。 两个新值被添加到 System.GenericUriParserOptions 枚举中,以指示自定义分析器是否支持 IRI 和 IDN。

有关 IRI 和 IDN 支持的更多信息,请参见 System.Uri 类的“备注”部分。

System.GenericUriParser 类例子


继承层次结构

System.Object

System.UriParser

System.GenericUriParser

命名空间

namespace: System

程序集: System(在 System.dll 中)

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

版本信息

.NET Framework 受以下版本支持:4、3.5、3.0、2.0 .NET Framework Client Profile 受以下版本支持:4、3.5 SP1

适用平台

Windows 7, Windows Vista SP1 或更高版本, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008(不支持服务器核心), Windows Server 2008 R2(支持 SP1 或更高版本的服务器核心), Windows Server 2003 SP2 .NET Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。

相关资源

System 命名空间
MSDN