System.Uri Members

The members of System.Uri are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the Uri class with the specified URI.

Initializes a new instance of the Uri class with the specified URI, with explicit control of character escaping.

Initializes a new instance of the Uri class with the specified URI. This constructor allows you to specify if the URI string is a relative URI, absolute URI, or is indeterminate.

Initializes a new instance of the Uri class based on the specified base URI and relative URI string.

Initializes a new instance of the Uri class based on the combination of a specified base Uri instance and a relative Uri instance.

Initializes a new instance of the Uri class based on the specified base and relative URIs, with explicit control of character escaping.

Protected Constructors

Public Fields

static readonly
SchemeDelimiterstring.

Specifies the characters that separate the communication protocol scheme from the address portion of the URI. This field is read-only.

static readonly
UriSchemeFilestring (file).

Specifies that the URI is a pointer to a file. This field is read-only.

static readonly
UriSchemeFtpstring (ftp).

Specifies that the URI is accessed through the File Transfer Protocol (FTP). This field is read-only.

static readonly
UriSchemeGopherstring (gopher).

Specifies that the URI is accessed through the Gopher protocol. This field is read-only.

static readonly
UriSchemeHttpstring (http).

Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only.

static readonly
UriSchemeHttpsstring (https).

Specifies that the URI is accessed through the Secure Hypertext Transfer Protocol (HTTPS). This field is read-only.

static readonly
UriSchemeMailtostring (mailto).

Specifies that the URI is an e-mail address and is accessed through the Simple Mail Transport Protocol (SMTP). This field is read-only.

static readonly
UriSchemeNetPipestring.

Specifies that the URI is accessed through the NetPipe scheme used by Windows Communication Foundation (WCF). This field is read-only.

static readonly
UriSchemeNetTcpstring.

Specifies that the URI is accessed through the NetTcp scheme used by Windows Communication Foundation (WCF). This field is read-only.

static readonly
UriSchemeNewsstring (news).

Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only.

static readonly
UriSchemeNntpstring (nntp).

Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only.

Public Properties

[read-only]
AbsolutePathstring.

Gets the absolute path of the URI.

[read-only]
AbsoluteUristring.

Gets the absolute URI.

[read-only]
Authoritystring.

Gets the Domain Name System (DNS) host name or IP address and the port number for a server.

[read-only]
DnsSafeHoststring.

Gets an unescaped host name that is safe to use for DNS resolution.

[read-only]
Fragmentstring.

Gets the escaped URI fragment.

[read-only]
Hoststring.

Gets the host component of this instance.

[read-only]
HostNameTypeUriHostNameType.

Gets the type of the host name specified in the URI.

[read-only]
IsAbsoluteUribool.

Gets whether the Uri instance is absolute.

[read-only]
IsDefaultPortbool.

Gets whether the port value of the URI is the default for this scheme.

[read-only]
IsFilebool.

Gets a value indicating whether the specified Uri is a file URI.

[read-only]
IsLoopbackbool.

Gets whether the specified Uri references the local host.

[read-only]
IsUncbool.

Gets whether the specified Uri is a universal naming convention (UNC) path.

[read-only]
LocalPathstring.

Gets a local operating-system representation of a file name.

[read-only]
OriginalStringstring.

Gets the original URI string that was passed to the Uri constructor.

[read-only]
PathAndQuerystring.

Gets the Uri.AbsolutePath and Uri.Query properties separated by a question mark (?).

[read-only]
Portint.

Gets the port number of this URI.

[read-only]
Querystring.

Gets any query information included in the specified URI.

[read-only]
Schemestring.

Gets the scheme name for this URI.

[read-only]
Segmentsstring[].

Gets an array containing the path segments that make up the specified URI.

[read-only]
UserEscapedbool.

Indicates that the URI string was completely escaped before the Uri instance was created.

[read-only]
UserInfostring.

Gets the user name, password, or other user-specific information associated with the specified URI.

Public Methods

static
CheckHostName(string) : UriHostNameType

Determines whether the specified host name is a valid DNS name.

static
CheckSchemeName(string) : bool

Determines whether the specified scheme name is valid.

static
Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) : int

Compares the specified parts of two URIs using the specified comparison rules.

override
Equals(object) : bool

Compares two Uri instances for equality.

static
EscapeDataString(string) : string

Converts a string to its escaped representation.

static
EscapeUriString(string) : string

Converts a URI string to its escaped representation.

static
FromHex(char) : int

Gets the decimal value of a hexadecimal digit.

GetComponents(UriComponents, UriFormat) : string

Gets the specified components of the current instance using the specified escaping for special characters.

override
GetHashCode() : int

Gets the hash code for the URI.

GetLeftPart(UriPartial) : string

Gets the specified portion of a Uri instance.

static
HexEscape(char) : string

Converts a specified character into its hexadecimal equivalent.

static
HexUnescape(string, ref int) : char
Converts a specified escaped hexadecimal representation of a character to the character.
IsBaseOf(Uri) : bool

Determines whether the current Uri instance is a base of the specified Uri instance.

static
IsHexDigit(char) : bool

Determines whether a specified character is a valid hexadecimal digit.

static
IsHexEncoding(string, int) : bool

Determines whether a character in a string is hexadecimal encoded.

IsWellFormedOriginalString() : bool

Indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped.

static
IsWellFormedUriString(string, UriKind) : bool

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.

MakeRelative(Uri) : string

Determines the difference between two Uri instances.

MakeRelativeUri(Uri) : Uri

Determines the difference between two Uri instances.

override
ToString() : string

Gets a canonical string representation for the specified Uri instance.

static
TryCreate(string, UriKind, out Uri) : bool
Documentation for this section has not yet been entered.
static
TryCreate(Uri, string, out Uri) : bool
Documentation for this section has not yet been entered.
static
TryCreate(Uri, Uri, out Uri) : bool
Documentation for this section has not yet been entered.
static
UnescapeDataString(string) : string

Converts a string to its unescaped representation.

Protected Methods

Canonicalize()

Converts the internally stored URI to canonical form.

CheckSecurity()

Calling this method has no effect.

Escape()

Converts any unsafe or reserved characters in the path component to their hexadecimal character representations.

static
EscapeString(string) : string

Converts a string to its escaped representation.

GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Returns the data needed to serialize the current instance.

IsBadFileSystemCharacter(char) : bool

Gets whether a character is invalid in a file system name.

static
IsExcludedCharacter(char) : bool

Gets whether the specified character should be escaped.

IsReservedCharacter(char) : bool

Gets whether the specified character is a reserved character.

Parse()

Parses the URI of the current instance to ensure it contains all the parts required for a valid URI.

Unescape(string) : string

Converts the specified string by replacing any escape sequences with their unescaped representation.

Public Operators

static
Equality(Uri, Uri)

Determines whether two Uri instances have the same value.

static
Inequality(Uri, Uri)

Determines whether two Uri instances do not have the same value.

Explicitly Implemented Interface Members

System.Runtime.Serialization.ISerializable.GetObjectData

Returns the data needed to serialize the current instance.