UriIdnScope Enum


提供 IdnElement 命名空间中的 System.Configuration 的配置设置的可能值。Provides the possible values for the configuration setting of the IdnElement in the System.Configuration namespace.

public enum class UriIdnScope
public enum UriIdnScope
type UriIdnScope = 
Public Enum UriIdnScope


All 2

此值会将所有 Unicode 域名转换为它们的 Punycode 等效项(IDN 名称)。This value will convert any Unicode domain names to their Punycode equivalents (IDN names).

AllExceptIntranet 1

此值会将所有外部 Unicode 域名转换为使用 Punycode 等效项(IDN 名称)。This value will convert all external Unicode domain names to use the Punycode equivalents (IDN names). 在这种情况下,若要处理本地 Intranet 上的国际化名称,用于 Intranet 的 DNS 服务器应该支持 Unicode 名称。In this case to handle international names on the local Intranet, the DNS servers that are used for the Intranet should support Unicode names.

None 0

此值不会将任何 Unicode 域名转换为使用 Punycode。This value will not convert any Unicode domain names to use Punycode. 这是与 .NET Framework 2.0 行为一致的默认值。This is the default value which is consistent with the .NET Framework 2.0 behavior.


现有的 Uri 类已扩展为基于 RFC 3987 提供对国际资源标识符(IR)的支持。The existing Uri class has been extended to provide support for International Resource Identifiers (IR) 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.

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

构造第一个 Uri 类时,将读取 System.Configuration.IdnElement 的配置设置。The configuration setting for the System.Configuration.IdnElement will be read once when the first Uri class is constructed. 忽略时间后更改为默认设置。Changes to configuration settings after that time are ignored.

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

Applies to

See also