Networking System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.x.x 1.0.5000.0 2.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object System.Runtime.Serialization.ISerializable

Provides an object representation of a uniform resource identifier (URI) as defined by IETF RFC 2396.

A Uniform Resource Identifier (URI) is a compact string of characters used to identify a resource located on a computer. A resource can be anything that has identity. Examples of resources that might be accessed using a URI include an electronic document, an image, a web service, and a collection of other resources. A URI is represented as a sequence of characters. While the exact format of a URI is determined by the protocol used to access the resource, many URI consist of four major components:

<>://<><>?<>

- Indicates a protocol used to access the resource.

- Indicates the naming authority (server or registry) that governs the namespace defined by the remainder of the URI. The authority component is composed of , and subcomponents in the form <>@<>:<>. Only the subcomponent is required to be present in the component. Authority information is stored in the property.

- Identifies the resource within the scope of the scheme and, if present, the authority. This information is stored in the , , and properties.

- Parameter information that is passed to the executable script identified by the URI. The query, if present, is the last element in a URI and begins with a "?". This information is stored in the property.

[Subcomponent of ] Consists of a user name and, optionally, scheme-specific authorization information used to access . The , if present, is separated from the component by the "@" character. Note that for some URI schemes, the format of the subcomponent is "username:password". Passing authorization information in this manner is strongly discouraged due to security issues. The information is stored in the property.

- [Subcomponent of ] The Domain Name system (DNS) name or IP4 address of a machine that provides access to the resource. This information is stored in the property.

- [Subcomponent of ] The network port number used to connect to the host. If no port number is specified in the URI, most schemes designate protocols that have a default port number. This information is stored in the property.

- The fragment is not part of the URI, but is used in conjunction with the URI and is included here for completeness. This component contains resource-specific information that is used after a resource is retrieved. The , if present, is separated from the URI by the "#" character. This information is stored in the property.

URIs include components consisting of or delimited by certain special (reserved) characters that have a special meaning in a URI component. If the reserved meaning is not intended, then the character is required to be escaped in the URI. An escaped character is encoded as a character triplet consisting of the percent character "%" followed by the US-ASCII character code specified as two hexadecimal digits. For example, "%20" is the escaped encoding for the US-ASCII space character. The URI represented by a

instance is always in "escaped" form. The following characters are reserved:

Semi-colon (";" )

Forward slash ( "/")

Question mark ( "?" )

Colon ( ":" )

At-sign ("@")

Ampersand ( "&" )

Equal sign ("=" )

Plus sign ("+" )

US Dollar sign ("$" )

Comma (",")

To transform the URI contained in a instance from an escape encoded URI to a human-readable URI, use the method.

URIs are stored as canonical URIs in escaped encoding, with all characters with ASCII values greater than 127 replaced with their hexadecimal equivalents. The constructors do not escape URI strings if the string is a well-formed URI, including a scheme identifier, that contains escape sequences. To put the URI in canonical form, the

constructors perform the following steps.

Converts the URI scheme to lowercase.

Converts the host name to lowercase.

Removes default and empty port numbers.

Simplifies the URI by removing superfluous segments such as "/" and "/test" segments.

The class stores only absolute URIs (for example, "http://www.contoso.com/index.htm"). Relative URIs (for example, "/new/index.htm") are expanded to absolute form using a specified base URI. The method converts absolute URIs to relative URIs.

The class properties are read-only; to modify a instance use the class.

- Constructor
  A containing a URI.

  Constructs and initializes a new instance of the class by parsing the specified URI.

  This constructor is equivalent to calling the (, ) constructor, and specifying and as the arguments.

  is .

  is a zero length string or contains only spaces.

  -or-

  is in an invalid form and cannot be parsed.

  0
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
- Constructor
  A containing a URI.
  if the URI in is already escaped; otherwise, .

  Constructs and initializes a new instance of the class by parsing the specified URI.

  This constructor parses the URI, places its components into the appropriate properties, and puts the URI in canonical form. If the specified URI does not contain a scheme component, the URI is parsed using "file" as the scheme.

  is .

  is a zero length string or contains only spaces.

  -or-

  The parsing routine detected a scheme in an invalid form.

  -or-

  The parser detected more than two consecutive slashes in a URI that does not use the "file" scheme.

  -or-

  is in an invalid form and cannot be parsed.

  The following example creates a instance for the URI "http://www.contoso.com/Hello%20World.htm". Because the URI contains escaped characters, the third parameter, , is set to .

  using System;

  public class UriTest { public static void Main() {

  Uri myUri = new Uri("http://www.contoso.com/Hello%20World.htm", true);

  Console.WriteLine(myUri.ToString()); } }

  The output is

  http://www.contoso.com/Hello World.htm

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Constructor
  2.0.0.0
  To be added.
  To be added.
  To be added.
  To be added.
- Constructor
  A containing a base URI.
  A containing a relative URI.

  Constructs and initializes a new instance of the class by combining the specified base and relative URIs.

  This constructor is equivalent to calling the (, , ) constructor, and specifying and as the arguments.

  is in an invalid form.

  is .
  0
  1.0.5000.0
  2.0.0.0
- Constructor
  2.0.0.0
  To be added.
  To be added.
  To be added.
  To be added.
- Constructor
  A containing the base URI. This parameter can, but is not required to contain a terminating slash ("/") character.
  A containing the relative URI to add to the base URI. This parameter can, but is not required to contain a leading slash ("/") character.
  if and are already escaped; otherwise, .

  Constructs and initializes a new instance of the class by combining the specified base and relative URIs.

  This constructor compensates for the presence or absence of a terminating slash in and/or a leading slash in to produce a well-formed URI.

  If the relative URI contains a that is the same as the scheme of the base URI and the is not present, or the relative URI does not contain a scheme, the new instance is composed of the relative URI (without its scheme component, if any) qualified by the scheme and authority information from the base URI.

  If the relative URI contains a followed by the , it is treated as an absolute URI and the base URI is ignored. If the relative URI contains a scheme that differs from the scheme of the base URI, the base URI is ignored. If the is not present in the relative URI, it is assumed, and the new instance is constructed as though the relative URI were an absolute URI.

  When the base URI is ignored, only the components of the relative URI are used to construct the new instance.

  is in an invalid form.

  is .

  The following example creates new instances of the class by combining a instance representing the base URI and a string containing a relative URI.

  using System;

  public class UriTest { public static void Main() {

  // Typical base and relative URI constructor usage.

  Uri baseUri = new Uri("http://www.contoso.com", true); Uri myUri = new Uri(baseUri, "index.htm",true); Console.WriteLine("Typical usage: {0}",myUri.ToString());

  // Base and relative URI contain slashes. Uri baseUri2 = new Uri("http://www.contoso.com/", true); Uri myUri2 = new Uri(baseUri2, "/index.htm",true); Console.WriteLine("Slash example: {0}",myUri2.ToString());

  // Relative URI contains a different scheme than the base URI. Uri baseUri3 = new Uri("http://www.contoso.com/", true); Uri myUri3 = new Uri(baseUri3, "ftp://www.contoso2.com/index.htm",true); Console.WriteLine("Different schemes: {0}", myUri3.ToString());

  // Relative URI contains the same scheme as the base URI. // The scheme delimiter is not present in the relative URI. Uri baseUri4 = new Uri("http://www.contoso.com/", true); Uri myUri4 = new Uri(baseUri4, "http:www.contoso2.com/index.htm",true); Console.WriteLine("Same schemes - relative treated as relative: {0}",myUri4.ToString());

  // Relative URI contains the same scheme as the base URI. // The scheme delimiter is present in the relative URI. Uri baseUri5 = new Uri("http://www.contoso.com/", true); Uri myUri5 = new Uri(baseUri5, "http://www.contoso2/index.htm",true); Console.WriteLine("Same schemes - relative treated as absolute: {0}",myUri5.ToString());

  } }

  The output is

  Typical usage: http://www.contoso.com/index.htm

  Slash example: http://www.contoso.com/index.htm

  Different schemes: ftp://www.contoso2.com/index.htm

  Same schemes - relative treated as relative: http://www.contoso.com/www.contoso2 .com/index.htm

  Same schemes - relative treated as absolute: http://www.contoso2/index.htm

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("dontEscape is always false")
- Property
  System.String

  Gets the absolute path of the resource identified by the current instance.

  A containing the absolute path to the resource.

  This property is read-only.

  The property contains the path to the resource identified by the current instance. The property always returns at least a slash ('/').

  If, when the current instance was constructed, the URI was already escaped or the constructor's parameter was set to , the value returned by this property is escaped.

  The path information does not include the scheme, host name, query, or fragment components of the URI.

  The following example outputs the absolute path of a URI.

  `using System; public class UriTest { public static void Main() { Uri myUri = new Uri ("http://www.contoso.com/URI/Hello%20World.htm?date=today", true); Console.WriteLine(myUri.AbsolutePath); } }`

  The output is

  /URI/Hello%20World.htm

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.String

  Gets the absolute URI of the resource identified by the current instance in canonical form.

  A containing the URI used to construct the current instance, in canonical format.

  This property is read-only.

  The property includes the entire URI stored in the current instance, including any fragment or query information. If, when the current instance was constructed, the URI was already escaped or the constructor's parameter was set to , the value returned by this property is escaped.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.String

  Gets the authority component of the URI used to construct the current instance.

  A containing the authority component of the current instance. The value returned by this property is composed of the values returned by the and properties.

  This property is read-only.

  The property returns the and information specified in the URI used to construct the current instance. The value of this property includes the port information only if the URI specified a port that is not the default for the current scheme. When port information is included in the value returned by this property, the host and port are separated by a colon (":").

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Converts the components of the URI represented by the current instance to canonical form.

  This method converts the URI to a format suitable for machine interpretation according to the scheme of the current instance. The conversions are required to preserve all information that could, if removed or altered, change the URI represented by the current instance.

  This method performs the following conversions:

  Converts file references to the format of the current platform, for example on a Windows system, file://c|/AFile.txt is converted to "file:///c:/AFile.txt".

  Converts any backslash characters ('\') to forward slashes ('/').

  Compresses multiple consecutive forward slashes ('/') in the path component to a single forward slash.

  Compresses any path meta sequences ("/." and "/..").

  Override this method to canonicalize the type derived from .

  Applications do not call this method; it is called by constructors after parsing the URI and escaping the components.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("This method does nothing, it has been obsoleted")
- Method
  System.UriHostNameType `` A containing the host name to validate.

  Returns a value that describes the format of a host name string.

  A that indicates the type of the host name. If the type of the host name cannot be determined, or the host name is or a zero-length string, returns .

  To be added.

  The following example demonstrates using the method.

  `using System; public class UriTest { public static void Main() { Console.WriteLine(Uri.CheckHostName("www.contoso.com")); } }`

  The output is

  Dns

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` A containing the scheme name to validate.

  Returns a value indicating whether the specified scheme name is valid.

  if the scheme name is valid; otherwise, . If is or is a zero-length string, returns .

  The scheme name is required to begin with a letter, and contain only letters, digits, and the characters '.', '+' or '-'.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Checks the current instance for character sequences that can result in unauthorized access to resources, and removes them.

  This method checks for invalid or dangerous character sequences in the components of the current instance, and removes them. The semantics that determine whether a character sequence presents a security risk are determined by the scheme of the current instance.

  The default implementation does nothing.

  Override this method to provide security checks for types derived from .

  Invoke this method on instances of types derived from to remove any URI content that allows unauthorized access to resources.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Method
  2.0.0.0
  System.Int32 `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  System.String To be added. To be added. To be added.
- Method
  System.Boolean `` The instance to compare with the current instance. This argument can be a or a .

  Compares the current instance and the specified object for equality.

  if represents the same URI (ignoring any fragment or query information) as the current instance; otherwise, . If is , a zero-length string, or is not an instance of or , returns false.

  If is a , it is converted to a by calling ().

  The , and unescaped version of the of the current instance and are compared for equality.

  If the scheme of the current instance is the scheme, the absolute paths are compared in accordance with the case sensitivity of the current platform.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Converts any unsafe or reserved characters in the component to equivalent escaped hexadecimal sequences.

  Converts any unsafe or reserved characters in the component to a character sequence consisting of a "%" followed by the hexadecimal value of the character as described by IETF 2396.

  If the path component of the current instance is , the escaped path is .

  As described above.

  Override this method to customize the escaping behavior provided by the type.

  Applications typically do not call this method; it is intended for use by the constructors.

  For additional information on escaping URI, see section 2 of RFC 2396.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Method
  2.0.0.0
  System.String `` To be added. To be added. To be added. To be added.
- Method
  System.String `` A to convert to its escaped representation.

  Converts a string to its escaped representation.

  A containing the escaped representation of .

  The string is escaped in accordance with RFC 2396.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Method
  2.0.0.0
  System.String `` To be added. To be added. To be added. To be added.
- Property
  System.String

  Gets the fragment component of the URI used to construct the current instance.

  A containing any fragment information contained in the URI used to construct the current instance.

  This property is read-only.

  The property gets any text following a fragment marker ('#') in the URI, including the fragment marker itself. If, when the current instance was constructed, the URI was already escaped or the constructor's parameter was set to , the value returned by this property is escaped.

  The property is not considered in a comparison.

  The following example demonstrates the use of the property.

  `using System; public class UriTest { public static void Main() { Uri baseUri = new Uri("http://www.contoso.com/"); Uri myUri = new Uri(baseUri, "index.htm#main"); Console.WriteLine(myUri.Fragment); } }`

  The output is

  #main

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Int32 `` The hexadecimal digit (0-9, a-f, A-F) to convert.

  Returns the decimal value of a hexadecimal digit.

  A containing an integer from 0 - 15 that corresponds to the specified hexadecimal digit.

  To be added. is not a valid hexadecimal digit (0-9, a-f, A-F). 0 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.String `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  System.Int32

  Generates a hash code for the current instance.

  A containing the hash code for this instance.

  The hash code is generated without the fragment component. For example, the URIs "http://www.contoso.com/index.htm#search" and "http://www.contoso.com/index.htm" produce the same hash code.

  The algorithm used to generate the hash code is unspecified.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.String `` A value that specifies the component to return.

  Returns the specified portion of the URI represented by the current instance.

  A containing all components up to the specified portion of the URI, or if the current instance does not contain the component identified by .

  The method returns a string containing the URI components starting with the left-most component of the URI and ending with the component specified by . The returned string does not include fragment or query information.

  includes delimiters as follows:

  has the scheme delimiter added.
  does not have the path delimiter added.
  includes any delimiters in the original URI up to the query or fragment delimiter.
  The parameter is not a valid value.

  The following example demonstrates the method.

  `using System; public class UriTest { public static void Main() { string[] myUri = { "http://www.contoso.com/index.htm", "http:www.contoso.com/index.htm#mark", "mailto:user@contoso.com?subject=uri", "nntp://news.contoso.com/123456@contoso.com" }; foreach (string s in myUri) { Uri aUri = new Uri(s); Console.WriteLine("URI: {0}", aUri.ToString()); Console.WriteLine("Scheme: {0}",aUri.GetLeftPart(UriPartial.Scheme)); Console.WriteLine("Authority: {0}",aUri.GetLeftPart(UriPartial.Authority)); Console.WriteLine("Path: {0}",aUri.GetLeftPart(UriPartial.Path)); } } }`

  The output is

  URI: http://www.contoso.com/index.htm

  Scheme: http://

  Authority: http://www.contoso.com

  Path: http://www.contoso.com/index.htm

  URI: http://www.contoso.com/index.htm#mark

  Scheme: http://

  Authority: http://www.contoso.com

  Path: http://www.contoso.com/index.htm

  URI: mailto:user@contoso.com?subject=uri

  Scheme: mailto:

  Authority:

  Path: mailto:user@contoso.com

  URI: nntp://news.contoso.com/123456@contoso.com

  Scheme: nntp://

  Authority: nntp://news.contoso.com

  Path: nntp://news.contoso.com/123456@contoso.com

  0
  1.0.5000.0
  2.0.0.0
- Method
  2.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Method
  System.String `` A containing the character to convert to escaped hexadecimal representation.

  Converts a specified ASCII character into its escaped hexadecimal equivalent.

  A containing the escaped hexadecimal representation of the specified character.

  The returned string is in the form "%XX", where X represents a hexadecimal digit (0-9, A-F).

  The numerical value of is greater than 255. 0 1.0.5000.0 2.0.0.0
- Method
  System.Char `` `` A containing the hexadecimal representation of a character. A containing the location in where the hexadecimal representation of a character begins.

  Converts a specified escaped hexadecimal representation of a character to the character.

  A containing a character. If the character pointed to by is a "%" and there are at least two characters following the "%", and the two characters are valid hexadecimal digits, the hexadecimal digits are converted to . Otherwise, the character at is returned. Valid hexadecimal digits are: 0-9, a-f, A-F.

  On return, the value of contains the index of the character following the one returned.

  To be added. 0, or >= the number of characters in pattern. 0 1.0.5000.0 2.0.0.0
- Property
  System.String

  Gets the host component of the URI used to construct the current instance.

  A containing the DNS host name or IP address of the host server. If the host information was not specified to the constructor, the value of this property is .

  This property is read-only.

  If the host information is an IP6 address, the information is enclosed in square brackets ("[" and "]").

  The following example demonstrates using the property.

  `using System; public class UriTest { public static void Main() { Uri baseUri = new Uri("http://www.contoso.com:8080/"); Uri myUri = new Uri(baseUri, "shownew.htm?date=today"); Console.WriteLine(myUri.Host); } }`

  The output is

  www.contoso.com

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.UriHostNameType

  Gets the format of the host address in the URI used to construct the current instance.

  A that indicates the format of the host address information in the current instance.

  This property is read-only.

  If is , the value of this property is .

  0
  1.0.5000.0
  2.0.0.0
- Property
  2.0.0.0
  System.Boolean To be added. To be added. To be added.
- Method
  System.Boolean `` A containing the character to check.

  Returns a value that indicates whether the specified character would be an invalid character if used in a file system name.

  if the specified character is not acceptable for use in a file system name; otherwise, .

  The value returned by this method is implementation-specific.

  This method returns if the specified character cannot be used in a URI that identifies a file, as defined by the current file system on the current platform.

  As described above.

  Override this method to provide a check for invalid characters as defined by the current file system on the current platform.

  Use this method to determine if a character can be used in a file name.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Method
  2.0.0.0
  System.Boolean `` To be added. To be added. To be added. To be added.
- Property
  System.Boolean

  Gets a value indicating whether the value of the current instance is the default port for the scheme of the current instance.

  if the value in the property is the default port for the ; otherwise, .

  This property is read-only.

  For a list of default port values, see the property.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` A containing the character to check.

  Returns a value that indicates whether the specified character is excluded from use or is unwise in URIs, as defined by IETF RFC 2396.

  if the specified character is required to be escaped; otherwise, .

  This method returns for the following characters:

  Character(s)
  Description
  < 0x0020
  Any character with the ASCII value less than hexadecimal 0x20 (32).
  < 0x007f
  Any character with the ASCII value greater than hexadecimal 0x7f (127).
  <
  Less than sign.
  >
  Greater than sign.
  #
  Number sign (crosshatch, pound sign).
  %
  Percent.
  "

  Quotation mark.

  {
  Left curly brace.
  }
  Right curly brace.
  |
  Pipe sign (vertical bar).
  \
  Backward slash.
  ^
  Circumflex (caret).
  [
  Left square bracket.
  ]
  Right square bracket.
  `
  Grave accent. 0 1.0.5000.0 2.0.0.0 System.Obsolete
- Property
  System.Boolean

  Gets a value indicating whether the current instance identifies a file.

  if the resource identified by the current is a file; otherwise, .

  This property is read-only.

  The property is when the property equals .

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` A containing the character to validate.

  Returns a value that indicates whether the specified character is a valid hexadecimal digit.

  if the character is a valid hexadecimal digit (0-9, A-F, a-f); otherwise .

  To be added. 0 1.0.5000.0 2.0.0.0
- Method
  System.Boolean `` `` The to check. A containing the location in to check for hex encoding.

  Returns a value that indicates whether a substring of the specified string is in escaped hexadecimal encoding format ("%" followed by two hexadecimal characters).

  if the specified location in contains a substring in escaped hexadecimal encoding format; otherwise, .

  The method checks for hexadecimal digits case-insensitively.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean

  Gets a value indicating whether the host information of the current instance is the current computer.

  if the host of the current instance is the reserved hostname "localhost" or the loop-back IP address (127.0.0.1); otherwise, .

  This property is read-only.

  The following example demonstrates the property.

  `using System; public class UriTest { public static void Main() { Uri myUri = new Uri("http://127.0.0.1/index.htm", true); Console.WriteLine("{0} is loopback? {1}", myUri.ToString(), myUri.IsLoopback); myUri = new Uri("http://localhost/index.htm", true); Console.WriteLine("{0} is loopback? {1}", myUri.ToString(), myUri.IsLoopback); } }`

  The output is

  http://127.0.0.1/index.htm is loopback? True

  http://localhost/index.htm is loopback? True

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` To be added.

  Returns a value that indicates whether a character is part of the URI reserved set.

  if is a URI reserved character as defined by IETF RFC 2396; otherwise, .

  The following characters are reserved for the use in URI:

  Character
  Description
  ;
  Semi-colon.
  /
  Forward slash.
  :
  Colon.
  @
  At sign (commercial at).
  &
  Ampersand.
  =
  Equals sign.
  +
  Plus sign.
  $
  US Dollar sign.
  ,
  Comma.

  As described above.

  Override this method to customize the escaping behavior provided by the type.

  Use this method to determine if a character is reserved.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Property
  System.Boolean To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Boolean To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Property
  System.String

  Gets the local operating-system representation of the resource identified by the current instance.

  A containing the local representation of the resource identified by the current instance.

  This property is read-only.

  If the of the current instance is not equal to , this property returns the same value as .

  If the scheme is equal to , this property returns an unescaped platform-dependent local representation of the file name.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.String `` The URI to compare to the current URI.

  Returns the specified as a relative URI.

  A with the difference between the current instance and if the two URIs are the same except for the path information. If the two URIs differ in more than the , this method returns the representation of .

  To be added.

  The following example demonstrates the method.

  `using System; public class UriTest { public static void Main() { Uri myUri = new Uri("http://www.contoso.com/Hello%20World.htm", true); Console.WriteLine(myUri.ToString()); Console.WriteLine(myUri.MakeRelative(new Uri ("http://www.contoso.com/index.htm"))); } }`

  The output is

  http://www.contoso.com/Hello World.htm

  index.htm

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Use MakeRelativeUri(Uri uri) instead.")
- Method
  2.0.0.0
  System.Uri `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  System.String To be added. To be added. To be added.
- Method
  System.Void

  Parses the URI into its constituent components.

  This method parses the property, separates it into various URI components, and stores the components in the appropriate properties.

  This method parses path components as defined in IETF RFC 2396.

  Override this method to provide parsing for URIs in formats that are not defined in IETF RFC 2396.

  Applications typically do not call this method; it is intended for use by the constructors.

  The scheme of the URI is in an invalid format.

  -or-

  The URI is in an invalid form and cannot be parsed.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("The method has been deprecated. It is not used by the system.")
- Property
  System.String

  Gets the and components of the URI used to construct the current instance.

  A that contains the values of the and properties.

  This property is read-only.

  The following example uses the property to extract the path and query information from a instance.

  `using System; public class UriTest { public static void Main() { Uri baseUri = new Uri("http://www.contoso.com/"); Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today"); Console.WriteLine(myUri.PathAndQuery); } }`

  The output is

  /catalog/shownew.htm?date=today

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Int32

  Gets the port number used to connect to the referenced by the current instance.

  A containing the port number, or -1 if no port is used by the URI . If no port was specified as part of the URI used to construct the current instance, the property returns the default port for the URI scheme.

  This property is read-only.

  The following table lists the default port number for each supported scheme.

  Scheme
  Port
  file
  -1
  ftp
  21
  gopher
  70
  http
  80
  https
  43
  mailto
  25
  news
  119
  nntp
  119 0 1.0.5000.0 2.0.0.0
- Property
  System.String

  Gets the query component of the URI used to construct the current instance.

  A containing the query information included in the specified URI, or .

  This property is read-only.

  If, when the current instance was constructed, the URI was already escaped or the constructor's parameter was set to , the value returned by this property is escaped.

  Query information is separated from the path information by a question mark ('?') and is located at the end of a URI. The query information includes the leading question mark.

  The following example uses the property to extract the query from a URI.

  `using System; public class UriTest { public static void Main() { Uri baseUri = new Uri("http://www.contoso.com/"); Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today"); Console.WriteLine(myUri.Query); } }`

  The output is

  ?date=today

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.String

  Gets the scheme component of the URI used to construct the current instance.

  A containing the URI scheme.

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String

  A containing the characters that separate the scheme component from the remainder of a URI.

  This field is read-only. The value of this field is "://".

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.String[] To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  1.0.5000.0
  2.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Method
  System.String

  Returns the unescaped, canonical form of the URI information used to construct the current instance.

  A containing the unescaped, canonical form of the URI represented by the current instance.

  The string returned by this method includes the and components.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
- Method
  2.0.0.0
  System.Boolean `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Boolean `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Boolean `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  System.String `` The to unescape.

  Converts escape sequences in the specified into their unescaped equivalents.

  A containing with its escaped characters converted to their unescaped equivalents. If path is or a zero-length string, returns .

  Escape sequences can be hex-encoded reserved characters (for example "%40") or hex-encoded UTF-8 sequences (for example "%C4%D2").

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete
- Method
  2.0.0.0
  System.String `` To be added. To be added. To be added. To be added.
- Field
  System.String file

  A containing the characters that indicate that a URI identifies a file.

  This field is read-only. The value of this field is "file".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String ftp

  A containing the characters that indicate that a URI is accessed through the File Transfer Protocol (FTP).

  This field is read-only. The value of this field is "ftp".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String gopher

  A containing the characters that indicate that a URI is accessed through the Gopher protocol.

  This field is read-only. The value of this field is "gopher".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String http

  A containing the characters that indicate that a URI is accessed through the Hypertext Transfer Protocol (HTTP).

  This field is read-only. The value of this field is "http".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String https

  A containing the characters that indicate that a URI is accessed through the Secure Hypertext Transfer Protocol (HTTPS).

  This field is read-only. The value of this field is "https".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String mailto

  A containing the characters that indicate that a URI is an email address and is accessed through the Simple Network Mail Protocol (SNMP).

  This field is read-only. The value of this field is "mailto".

  0
  1.0.5000.0
  2.0.0.0
- Field
  2.0.0.0
  System.String To be added. To be added.
- Field
  2.0.0.0
  System.String To be added. To be added.
- Field
  System.String news

  A containing the characters that indicate that a URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP).

  This field is read-only. The value of this field is "news".

  0
  1.0.5000.0
  2.0.0.0
- Field
  System.String nntp

  A containing the characters that indicate that a URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP).

  This field is read-only. The value of this field is "nntp".

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean

  Gets a value that indicates whether the URI information used to construct the current instance was escaped before the current instance was created.

  if the parameter of the constructor for the current instance was set to ; otherwise, .

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.String

  Gets the userinfo component of the URI used to construct the current instance.

  A containing any user information included in the URI used to construct the current instance, or if no user information was included.

  This property is read-only.

  For details on the userinfo component of a URI, see IETF RFC 2396, 3.2.2.

  0
  1.0.5000.0
  2.0.0.0
0 System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))