mscorlib(4.0.0.0) API with additions
|
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI. More...
Public Member Functions | |
Uri (string uriString) | |
Initializes a new instance of the T:System.Uri class with the specified URI. More... | |
Uri (string uriString, bool dontEscape) | |
Initializes a new instance of the T:System.Uri class with the specified URI, with explicit control of character escaping. More... | |
Uri (Uri baseUri, string relativeUri, bool dontEscape) | |
Initializes a new instance of the T:System.Uri class based on the specified base and relative URIs, with explicit control of character escaping. More... | |
Uri (string uriString, UriKind uriKind) | |
Initializes a new instance of the T:System.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. More... | |
Uri (Uri baseUri, string relativeUri) | |
Initializes a new instance of the T:System.Uri class based on the specified base URI and relative URI string. More... | |
Uri (Uri baseUri, Uri relativeUri) | |
Initializes a new instance of the T:System.Uri class based on the combination of a specified base T:System.Uri instance and a relative T:System.Uri instance. More... | |
string | GetLeftPart (UriPartial part) |
Gets the specified portion of a T:System.Uri instance. More... | |
override int | GetHashCode () |
Gets the hash code for the URI. More... | |
override string | ToString () |
Gets a canonical string representation for the specified T:System.Uri instance. More... | |
unsafe override bool | Equals (object comparand) |
Compares two T:System.Uri instances for equality. More... | |
Uri | MakeRelativeUri (Uri uri) |
Determines the difference between two T:System.Uri instances. More... | |
string | MakeRelative (Uri toUri) |
Determines the difference between two T:System.Uri instances. More... | |
string | GetComponents (UriComponents components, UriFormat format) |
Gets the specified components of the current instance using the specified escaping for special characters. More... | |
bool | IsWellFormedOriginalString () |
Indicates whether the string used to construct this T:System.Uri was well-formed and is not required to be further escaped. More... | |
bool | IsBaseOf (Uri uri) |
Determines whether the current T:System.Uri instance is a base of the specified T:System.Uri instance. More... | |
Static Public Member Functions | |
static unsafe UriHostNameType | CheckHostName (string name) |
Determines whether the specified host name is a valid DNS name. More... | |
static string | HexEscape (char character) |
Converts a specified character into its hexadecimal equivalent. More... | |
static char | HexUnescape (string pattern, ref int index) |
Converts a specified hexadecimal representation of a character to the character. More... | |
static bool | IsHexEncoding (string pattern, int index) |
Determines whether a character in a string is hexadecimal encoded. More... | |
static bool | CheckSchemeName (string schemeName) |
Determines whether the specified scheme name is valid. More... | |
static bool | IsHexDigit (char character) |
Determines whether a specified character is a valid hexadecimal digit. More... | |
static int | FromHex (char digit) |
Gets the decimal value of a hexadecimal digit. More... | |
static bool | operator== (Uri uri1, Uri uri2) |
Determines whether two T:System.Uri instances have the same value. More... | |
static bool | operator != (Uri uri1, Uri uri2) |
Determines whether two T:System.Uri instances do not have the same value. More... | |
static bool | TryCreate (string uriString, UriKind uriKind, out Uri result) |
Creates a new T:System.Uri using the specified T:System.String instance and a T:System.UriKind. More... | |
static bool | TryCreate (Uri baseUri, string relativeUri, out Uri result) |
Creates a new T:System.Uri using the specified base and relative T:System.String instances. More... | |
static bool | TryCreate (Uri baseUri, Uri relativeUri, out Uri result) |
Creates a new T:System.Uri using the specified base and relative T:System.Uri instances. More... | |
static int | Compare (Uri uri1, Uri uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType) |
Compares the specified parts of two URIs using the specified comparison rules. More... | |
static bool | IsWellFormedUriString (string uriString, UriKind uriKind) |
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. More... | |
static unsafe string | UnescapeDataString (string stringToUnescape) |
Converts a string to its unescaped representation. More... | |
static string | EscapeUriString (string stringToEscape) |
Converts a URI string to its escaped representation. More... | |
static string | EscapeDataString (string stringToEscape) |
Converts a string to its escaped representation. More... | |
Static Public Attributes | |
static readonly string | UriSchemeFile = UriParser.FileUri.SchemeName |
Specifies that the URI is a pointer to a file. This field is read-only. More... | |
static readonly string | UriSchemeFtp = UriParser.FtpUri.SchemeName |
Specifies that the URI is accessed through the File Transfer Protocol (FTP). This field is read-only. More... | |
static readonly string | UriSchemeGopher = UriParser.GopherUri.SchemeName |
Specifies that the URI is accessed through the Gopher protocol. This field is read-only. More... | |
static readonly string | UriSchemeHttp = UriParser.HttpUri.SchemeName |
Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only. More... | |
static readonly string | UriSchemeHttps = UriParser.HttpsUri.SchemeName |
Specifies that the URI is accessed through the Secure Hypertext Transfer Protocol (HTTPS). This field is read-only. More... | |
static readonly string | UriSchemeMailto = UriParser.MailToUri.SchemeName |
Specifies that the URI is an e-mail address and is accessed through the Simple Mail Transport Protocol (SMTP). This field is read-only. More... | |
static readonly string | UriSchemeNews = UriParser.NewsUri.SchemeName |
Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only. More... | |
static readonly string | UriSchemeNntp = UriParser.NntpUri.SchemeName |
Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only. More... | |
static readonly string | UriSchemeNetTcp = UriParser.NetTcpUri.SchemeName |
Specifies that the URI is accessed through the NetTcp scheme used by Windows Communication Foundation (WCF). This field is read-only. More... | |
static readonly string | UriSchemeNetPipe = UriParser.NetPipeUri.SchemeName |
Specifies that the URI is accessed through the NetPipe scheme used by Windows Communication Foundation (WCF). This field is read-only. More... | |
static readonly string | SchemeDelimiter = "://" |
Specifies the characters that separate the communication protocol scheme from the address portion of the URI. This field is read-only. More... | |
Protected Member Functions | |
Uri (SerializationInfo serializationInfo, StreamingContext streamingContext) | |
Initializes a new instance of the T:System.Uri class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes. More... | |
void | GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) |
Returns the data needed to serialize the current instance. More... | |
virtual void | Parse () |
Parses the URI of the current instance to ensure it contains all the parts required for a valid URI. More... | |
virtual void | Canonicalize () |
Converts the internally stored URI to canonical form. More... | |
virtual void | Escape () |
Converts any unsafe or reserved characters in the path component to their hexadecimal character representations. More... | |
virtual string | Unescape (string path) |
Converts the specified string by replacing any escape sequences with their unescaped representation. More... | |
virtual void | CheckSecurity () |
Calling this method has no effect. More... | |
virtual bool | IsReservedCharacter (char character) |
Gets whether the specified character is a reserved character. More... | |
virtual bool | IsBadFileSystemCharacter (char character) |
Gets whether a character is invalid in a file system name. More... | |
Static Protected Member Functions | |
static string | EscapeString (string str) |
Converts a string to its escaped representation. More... | |
static bool | IsExcludedCharacter (char character) |
Gets whether the specified character should be escaped. More... | |
Properties | |
string | AbsolutePath [get] |
Gets the absolute path of the URI. More... | |
string | AbsoluteUri [get] |
Gets the absolute URI. More... | |
string | LocalPath [get] |
Gets a local operating-system representation of a file name. More... | |
string | Authority [get] |
Gets the Domain Name System (DNS) host name or IP address and the port number for a server. More... | |
UriHostNameType | HostNameType [get] |
Gets the type of the host name specified in the URI. More... | |
bool | IsDefaultPort [get] |
Gets whether the port value of the URI is the default for this scheme. More... | |
bool | IsFile [get] |
Gets a value indicating whether the specified T:System.Uri is a file URI. More... | |
bool | IsLoopback [get] |
Gets whether the specified T:System.Uri references the local host. More... | |
string | PathAndQuery [get] |
Gets the P:System.Uri.AbsolutePath and P:System.Uri.Query properties separated by a question mark (?). More... | |
string [] | Segments [get] |
Gets an array containing the path segments that make up the specified URI. More... | |
bool | IsUnc [get] |
Gets whether the specified T:System.Uri is a universal naming convention (UNC) path. More... | |
string | Host [get] |
Gets the host component of this instance. More... | |
int | Port [get] |
Gets the port number of this URI. More... | |
string | Query [get] |
Gets any query information included in the specified URI. More... | |
string | Fragment [get] |
Gets the escaped URI fragment. More... | |
string | Scheme [get] |
Gets the scheme name for this URI. More... | |
string | OriginalString [get] |
Gets the original URI string that was passed to the T:System.Uri constructor. More... | |
string | DnsSafeHost [get] |
Gets an unescaped host name that is safe to use for DNS resolution. More... | |
string | IdnHost [get] |
The RFC 3490 compliant International Domain Name of the host, using Punycode as appropriate. More... | |
bool | IsAbsoluteUri [get] |
Gets whether the T:System.Uri instance is absolute. More... | |
bool | UserEscaped [get] |
Indicates that the URI string was completely escaped before the T:System.Uri instance was created. More... | |
string | UserInfo [get] |
Gets the user name, password, or other user-specific information associated with the specified URI. More... | |
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.
System.Uri.Uri | ( | string | uriString | ) |
Initializes a new instance of the T:System.Uri class with the specified URI.
uriString | A URI. |
T:System.ArgumentNullException | uriString is null . |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead. uriString is empty.-or- The scheme specified in uriString is not correctly formed. See M:System.Uri.CheckSchemeName(System.String).-or- uriString contains too many slashes.-or- The password specified in uriString is not valid.-or- The host name specified in uriString is not valid.-or- The file name specified in uriString is not valid. -or- The user name specified in uriString is not valid.-or- The host or authority name specified in uriString cannot be terminated by backslashes.-or- The port number specified in uriString is not valid or cannot be parsed.-or- The length of uriString exceeds 65519 characters.-or- The length of the scheme specified in uriString exceeds 1023 characters.-or- There is an invalid character sequence in uriString .-or- The MS-DOS path specified in uriString must start with c:\. |
System.Uri.Uri | ( | string | uriString, |
bool | dontEscape | ||
) |
Initializes a new instance of the T:System.Uri class with the specified URI, with explicit control of character escaping.
uriString | The URI. |
dontEscape | true if uriString is completely escaped; otherwise, false . See Remarks. |
T:System.ArgumentNullException | uriString is null . |
T:System.UriFormatException | uriString is empty or contains only spaces.-or- The scheme specified in uriString is not valid.-or- uriString contains too many slashes.-or- The password specified in uriString is not valid.-or- The host name specified in uriString is not valid.-or- The file name specified in uriString is not valid. -or- The user name specified in uriString is not valid.-or- The host or authority name specified in uriString cannot be terminated by backslashes.-or- The port number specified in uriString is not valid or cannot be parsed.-or- The length of uriString exceeds 65519 characters.-or- The length of the scheme specified in uriString exceeds 1023 characters.-or- There is an invalid character sequence in uriString .-or- The MS-DOS path specified in uriString must start with c:\. |
System.Uri.Uri | ( | Uri | baseUri, |
string | relativeUri, | ||
bool | dontEscape | ||
) |
Initializes a new instance of the T:System.Uri class based on the specified base and relative URIs, with explicit control of character escaping.
baseUri | The base URI. |
relativeUri | The relative URI to add to the base URI. |
dontEscape | true if uriString is completely escaped; otherwise, false . See Remarks. |
T:System.ArgumentNullException | baseUri is null . |
T:System.ArgumentOutOfRangeException | baseUri is not an absolute T:System.Uri instance. |
T:System.UriFormatException | The URI formed by combining baseUri and relativeUri is empty or contains only spaces.-or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The URI formed by combining baseUri and relativeUri contains too many slashes.-or- The password specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed.-or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri .-or- The MS-DOS path specified in uriString must start with c:\. |
System.Uri.Uri | ( | string | uriString, |
UriKind | uriKind | ||
) |
Initializes a new instance of the T:System.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.
uriString | A string that identifies the resource to be represented by the T:System.Uri instance. |
uriKind | Specifies whether the URI string is a relative URI, absolute URI, or is indeterminate. |
T:System.ArgumentException | uriKind is invalid. |
T:System.ArgumentNullException | uriString is null . |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead. uriString contains a relative URI and uriKind is F:System.UriKind.Absolute.or uriString contains an absolute URI and uriKind is F:System.UriKind.Relative.or uriString is empty.-or- The scheme specified in uriString is not correctly formed. See M:System.Uri.CheckSchemeName(System.String).-or- uriString contains too many slashes.-or- The password specified in uriString is not valid.-or- The host name specified in uriString is not valid.-or- The file name specified in uriString is not valid. -or- The user name specified in uriString is not valid.-or- The host or authority name specified in uriString cannot be terminated by backslashes.-or- The port number specified in uriString is not valid or cannot be parsed.-or- The length of uriString exceeds 65519 characters.-or- The length of the scheme specified in uriString exceeds 1023 characters.-or- There is an invalid character sequence in uriString .-or- The MS-DOS path specified in uriString must start with c:\. |
System.Uri.Uri | ( | Uri | baseUri, |
string | relativeUri | ||
) |
Initializes a new instance of the T:System.Uri class based on the specified base URI and relative URI string.
baseUri | The base URI. |
relativeUri | The relative URI to add to the base URI. |
T:System.ArgumentNullException | baseUri is null . |
T:System.ArgumentOutOfRangeException | baseUri is not an absolute T:System.Uri instance. |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI formed by combining baseUri and relativeUri is empty or contains only spaces.-or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The URI formed by combining baseUri and relativeUri contains too many slashes.-or- The password specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed.-or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri .-or- The MS-DOS path specified in uriString must start with c:\. |
Initializes a new instance of the T:System.Uri class based on the combination of a specified base T:System.Uri instance and a relative T:System.Uri instance.
baseUri | An absolute T:System.Uri that is the base for the new T:System.Uri instance. |
relativeUri | A relative T:System.Uri instance that is combined with baseUri . |
T:System.ArgumentException | baseUri is not an absolute T:System.Uri instance. |
T:System.ArgumentNullException | baseUri is null . |
T:System.ArgumentOutOfRangeException | baseUri is not an absolute T:System.Uri instance. |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI formed by combining baseUri and relativeUri is empty or contains only spaces.-or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The URI formed by combining baseUri and relativeUri contains too many slashes.-or- The password specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid.-or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed.-or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri .-or- The MS-DOS path specified in uriString must start with c:\. |
|
protected |
Initializes a new instance of the T:System.Uri class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes.
serializationInfo | An instance of the T:System.Runtime.Serialization.SerializationInfo class containing the information required to serialize the new T:System.Uri instance. |
streamingContext | An instance of the T:System.Runtime.Serialization.StreamingContext class containing the source of the serialized stream associated with the new T:System.Uri instance. |
T:System.ArgumentNullException | The serializationInfo parameter contains a null URI. |
T:System.UriFormatException | The serializationInfo parameter contains a URI that is empty.-or- The scheme specified is not correctly formed. See M:System.Uri.CheckSchemeName(System.String).-or- The URI contains too many slashes.-or- The password specified in the URI is not valid.-or- The host name specified in URI is not valid.-or- The file name specified in the URI is not valid. -or- The user name specified in the URI is not valid.-or- The host or authority name specified in the URI cannot be terminated by backslashes.-or- The port number specified in the URI is not valid or cannot be parsed.-or- The length of URI exceeds 65519 characters.-or- The length of the scheme specified in the URI exceeds 1023 characters.-or- There is an invalid character sequence in the URI.-or- The MS-DOS path specified in the URI must start with c:\. |
|
protectedvirtual |
|
static |
Determines whether the specified host name is a valid DNS name.
name | The host name to validate. This can be an IPv4 or IPv6 address or an Internet host name. |
null
or a zero-length string, this method returns F:System.UriHostNameType.Unknown.
|
static |
Determines whether the specified scheme name is valid.
schemeName | The scheme name to validate. |
true
if the scheme name is valid; otherwise, false
.
|
protectedvirtual |
|
static |
Compares the specified parts of two URIs using the specified comparison rules.
uri1 | The first T:System.Uri. |
uri2 | The second T:System.Uri. |
partsToCompare | A bitwise combination of the T:System.UriComponents values that specifies the parts of uri1 and uri2 to compare. |
compareFormat | One of the T:System.UriFormat values that specifies the character escaping used when the URI components are compared. |
comparisonType | One of the T:System.StringComparison values. |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
unsafe override bool System.Uri.Equals | ( | object | comparand | ) |
Compares two T:System.Uri instances for equality.
comparand | The T:System.Uri instance or a URI identifier to compare with the current instance. |
true
if the two instances represent the same URI; otherwise, false
.
|
protectedvirtual |
Converts any unsafe or reserved characters in the path component to their hexadecimal character representations.
T:System.UriFormatException | The URI passed from the constructor is invalid. This exception can occur if a URI has too many characters or the URI is relative. |
|
static |
Converts a string to its escaped representation.
stringToEscape | The string to escape. |
T:System.ArgumentNullException | stringToEscape is null . |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The length of stringToEscape exceeds 32766 characters. |
|
staticprotected |
|
static |
Converts a URI string to its escaped representation.
stringToEscape | The string to escape. |
T:System.ArgumentNullException | stringToEscape is null . |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The length of stringToEscape exceeds 32766 characters. |
|
static |
Gets the decimal value of a hexadecimal digit.
digit | The hexadecimal digit (0-9, a-f, A-F) to convert. |
T:System.ArgumentException | digit is not a valid hexadecimal digit (0-9, a-f, A-F). |
string System.Uri.GetComponents | ( | UriComponents | components, |
UriFormat | format | ||
) |
Gets the specified components of the current instance using the specified escaping for special characters.
components | A bitwise combination of the T:System.UriComponents values that specifies which parts of the current instance to return to the caller. |
format | One of the T:System.UriFormat values that controls how special characters are escaped. |
T:System.ArgumentOutOfRangeException | components is not a combination of valid T:System.UriComponents values. |
T:System.InvalidOperationException | The current T:System.Uri is not an absolute URI. Relative URIs cannot be used with this method. |
override int System.Uri.GetHashCode | ( | ) |
Gets the hash code for the URI.
string System.Uri.GetLeftPart | ( | UriPartial | part | ) |
Gets the specified portion of a T:System.Uri instance.
part | One of the T:System.UriPartial values that specifies the end of the URI portion to return. |
T:System.InvalidOperationException | The current T:System.Uri instance is not an absolute instance. |
T:System.ArgumentException | The specified part is not valid. |
|
protected |
Returns the data needed to serialize the current instance.
serializationInfo | A T:System.Runtime.Serialization.SerializationInfo object containing the information required to serialize the T:System.Uri. |
streamingContext | A T:System.Runtime.Serialization.StreamingContext object containing the source and destination of the serialized stream associated with the T:System.Uri. |
Implements System.Runtime.Serialization.ISerializable.
|
static |
Converts a specified character into its hexadecimal equivalent.
character | The character to convert to hexadecimal representation. |
T:System.ArgumentOutOfRangeException | character is greater than 255. |
|
static |
Converts a specified hexadecimal representation of a character to the character.
pattern | The hexadecimal representation of a character. |
index | The location in pattern where the hexadecimal representation of a character begins. |
T:System.ArgumentOutOfRangeException | index is less than 0 or greater than or equal to the number of characters in pattern . |
|
protectedvirtual |
Gets whether a character is invalid in a file system name.
character | The T:System.Char to test. |
true
if the specified character is invalid; otherwise false
.bool System.Uri.IsBaseOf | ( | Uri | uri | ) |
Determines whether the current T:System.Uri instance is a base of the specified T:System.Uri instance.
uri | The specified T:System.Uri instance to test. |
true
if the current T:System.Uri instance is a base of uri ; otherwise, false
.T:System.ArgumentNullException | uri is null . |
|
staticprotected |
Gets whether the specified character should be escaped.
character | The T:System.Char to test. |
true
if the specified character should be escaped; otherwise, false
.
|
static |
Determines whether a specified character is a valid hexadecimal digit.
character | The character to validate. |
true
if the character is a valid hexadecimal digit; otherwise false
.
|
static |
Determines whether a character in a string is hexadecimal encoded.
pattern | The string to check. |
index | The location in pattern to check for hexadecimal encoding. |
true
if pattern is hexadecimal encoded at the specified location; otherwise, false
.
|
protectedvirtual |
Gets whether the specified character is a reserved character.
character | The T:System.Char to test. |
true
if the specified character is a reserved character otherwise, false
.bool System.Uri.IsWellFormedOriginalString | ( | ) |
Indicates whether the string used to construct this T:System.Uri was well-formed and is not required to be further escaped.
true
if the string was well-formed; else false
.
|
static |
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.
uriString | The string used to attempt to construct a T:System.Uri. |
uriKind | The type of the T:System.Uri in uriString . |
true
if the string was well-formed; else false
.string System.Uri.MakeRelative | ( | Uri | toUri | ) |
Determines the difference between two T:System.Uri instances.
toUri | The URI to compare to the current URI. |
T:System.ArgumentNullException | toUri is null . |
T:System.InvalidOperationException | This instance represents a relative URI, and this method is valid only for absolute URIs. |
Determines the difference between two T:System.Uri instances.
uri | The URI to compare to the current URI. |
T:System.ArgumentNullException | uri is null . |
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
Determines whether two T:System.Uri instances do not have the same value.
uri1 | A T:System.Uri instance to compare with uri2 . |
uri2 | A T:System.Uri instance to compare with uri1 . |
true
if the two T:System.Uri instances are not equal; otherwise, false
. If either parameter is null
, this method returns true
.Determines whether two T:System.Uri instances have the same value.
uri1 | A T:System.Uri instance to compare with uri2 . |
uri2 | A T:System.Uri instance to compare with uri1 . |
true
if the T:System.Uri instances are equivalent; otherwise, false
.
|
protectedvirtual |
override string System.Uri.ToString | ( | ) |
Creates a new T:System.Uri using the specified T:System.String instance and a T:System.UriKind.
uriString | The T:System.String representing the T:System.Uri. |
uriKind | The type of the Uri. |
result | When this method returns, contains the constructed T:System.Uri. |
true
if the T:System.Uri was successfully created; otherwise, false
.Creates a new T:System.Uri using the specified base and relative T:System.String instances.
baseUri | The base T:System.Uri. |
relativeUri | The relative T:System.Uri, represented as a T:System.String, to add to the base T:System.Uri. |
result | When this method returns, contains a T:System.Uri constructed from baseUri and relativeUri . This parameter is passed uninitialized. |
true
if the T:System.Uri was successfully created; otherwise, false
.Creates a new T:System.Uri using the specified base and relative T:System.Uri instances.
baseUri | The base T:System.Uri. |
relativeUri | The relative T:System.Uri to add to the base T:System.Uri. |
result | When this method returns, contains a T:System.Uri constructed from baseUri and relativeUri . This parameter is passed uninitialized. |
true
if the T:System.Uri was successfully created; otherwise, false
.T:System.ArgumentNullException | baseUri is null . |
|
protectedvirtual |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
get |
|
get |
|
get |
Gets the Domain Name System (DNS) host name or IP address and the port number for a server.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets an unescaped host name that is safe to use for DNS resolution.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
|
get |
Gets the host component of this instance.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
|
get |
|
get |
Gets whether the T:System.Uri instance is absolute.
true
if the T:System.Uri instance is absolute; otherwise, false
.
|
get |
Gets whether the port value of the URI is the default for this scheme.
true
if the value in the P:System.Uri.Port property is the default port for this scheme; otherwise, false
.T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets a value indicating whether the specified T:System.Uri is a file URI.
true
if the T:System.Uri is a file URI; otherwise, false
.T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets whether the specified T:System.Uri references the local host.
true
if this T:System.Uri references the local host; otherwise, false
.T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets whether the specified T:System.Uri is a universal naming convention (UNC) path.
true
if the T:System.Uri is a UNC path; otherwise, false
.T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets a local operating-system representation of a file name.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets the original URI string that was passed to the T:System.Uri constructor.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets the P:System.Uri.AbsolutePath and P:System.Uri.Query properties separated by a question mark (?).
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets the port number of this URI.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Gets any query information included in the specified URI.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
|
get |
Gets an array containing the path segments that make up the specified URI.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
|
get |
Indicates that the URI string was completely escaped before the T:System.Uri instance was created.
true
if the dontEscape parameter was set to true
when the T:System.Uri instance was created; otherwise, false
.
|
get |
Gets the user name, password, or other user-specific information associated with the specified URI.
T:System.InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |