[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.
Assembly: System.Http (in System.Http.dll)
Thetype exposes the following members.
|AbsolutePath||Gets the absolute path of the URI.|
|AbsoluteUri||Gets the absolute URI.|
|Host||Gets the host component of this instance.|
|HostNameType||Gets the type of the host name specified in the URI.|
|IsAbsoluteUri||Gets whether the instance is absolute.|
|IsLoopback||Gets whether the specified references the local host.|
|IsUnc||Gets whether the specified is a universal naming convention (UNC) path.|
|OriginalString||Gets the original URI string that was passed to the constructor.|
|Port||Gets the port number of this URI.|
|Scheme||Gets the scheme name for this URI.|
|ConstructAbsoluteUri||Constructs an absolute Uri from a URI string.|
|Equals||Compares two instances for equality. (Overrides Object..::..Equals(Object).)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Gets the hash code for the URI. (Overrides Object..::..GetHashCode()()()().)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|IsAlpha||Determines whehter the character value is an alpha character.|
|IsAlphaNumeric||Determines whether the character is an alpha or numeric.|
|IsHex||Determines whether the value is hexadecimal.|
|IsIPv4||Determines whether the host name is an IP address 4 bytes, such as 18.104.22.168.|
|IsWellFormedUriString||Indicates whether the string is well-formed by attempting to construct a URI with the string and ensures that the string does not require further escaping.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ParseUriString||Parses a URI string into Uri variables.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|ValidateRelativePath||Parses relative Uri into variables.|
|ValidateUriPart||Validates that part of Uri after scheme is valid for an unknown Uri scheme.|
|ValidateUrn||Parses urn string into Uri variables.|
|HttpDefaultPort||Contains the default port for http protocol. The value is set to 80.|
|HttpsDefaultPort||Contains the default port for https protocol. The value is set to 443.|
|m_AbsolutePath||Contains the absolute path of the URI.|
|m_Flags||Contains the internal flags.|
|m_host||Contains ttthe host name (http and https).|
|m_hostNameType||Contains the type of the host.|
|m_isAbsoluteUri||Contains the absolute URI.|
|m_isUnc||Contains a value that indicates whether the specified is a universal naming convention (UNC) path.|
|m_OriginalUriString||Contains the original URI string that was passed to the constructor.|
|m_port||Contains the port number of this URI.|
|m_scheme||Contains the scheme name for this URI.|
|UnknownPort||Contains a value used to indicate the port for this protocol is unknown.|
A URI is a compact representation of a resource available to your application on the intranet or Internet. The class defines the properties and methods for handling URIs, including parsing, comparing, and combining.
The constructors do not escape URI strings if the string is a well-formed URI including a scheme identifier.
The properties return a canonical data representation in escaped encoding, with all characters with Unicode values greater than 127 replaced with their hexadecimal equivalents. To put the URI in canonical form, the constructor performs the following steps:
Converts the URI scheme to lowercase.
Converts the host name to lowercase.
If the host name is an IPv6 address, the canonical IPv6 address is used. ScopeId and other optional IPv6 data are removed.
Removes default and empty port numbers.
Canonicalizes the path for hierarchical URIs by compacting sequences such as /./, /../, //, including escaped representations. Note that there are some schemes for which escaped representations are not compacted.
For hierarchical URIs, if the host is not terminated with a forward slash (/), one is added.
By default, any reserved characters in the URI are escaped in accordance with RFC 2396. This behavior changes if International Resource Identifiers or International Domain Name parsing is enabled in which case reserved characters in the URI are escaped in accordance with RFC 3986 and RFC 3987.