Breyta

Deila með


GenericUriParser(GenericUriParserOptions) Constructor

Definition

Create a customizable parser for a hierarchical URI.

public:
 GenericUriParser(GenericUriParserOptions options);
public GenericUriParser (GenericUriParserOptions options);
new GenericUriParser : GenericUriParserOptions -> GenericUriParser
Public Sub New (options As GenericUriParserOptions)

Parameters

options
GenericUriParserOptions

Specify the options for this GenericUriParser.

Remarks

Use this constructor as an argument to UriParser.Register(UriParser, String, Int32)

If you want to create a parser based on a well-known scheme, use HttpStyleUriParser, FtpStyleUriParser, GopherStyleUriParser, LdapStyleUriParser, or NewsStyleUriParser.

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.

The existing System.Uri class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names (IDN). Current users will not see any change from the .NET Framework 2.0 behavior unless they specifically enable IRI. This ensures application compatibility with prior versions of the .NET Framework.

All parsers derived from GenericUriParser will not gain IRI and IDN support by default. The Default option does not include IRI and IDN support. Two new values are added to the System.GenericUriParserOptions enumeration to indicate if a custom parser supports IRI and IDN.

The IriParsing type indicates the parser supports the parsing rules specified in RFC 3987 for International Resource Identifiers (IRI). Whether IRI is used is dictated by configuration values.

The Idn type indicates the parser supports Internationalized Domain Name (IDN) parsing (IDN) of host names. Whether IDN is used is dictated by configuration values.

The configuration setting for the System.Configuration.IdnElement is indirectly controlled by the System.Configuration.IriParsingElement configuration setting that controls IRI processing in the System.Uri class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.

The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default.

For more information on IRI and IDN support, see the Remarks section for the System.Uri class.

Applies to

See also