using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.IO; using System.Net; using System.Runtime.Serialization; using System.Text; namespace System { /// Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI. /// 1 // Token: 0x020002FB RID: 763 [global::System.ComponentModel.TypeConverter(typeof(global::System.UriTypeConverter))] [Serializable] public class Uri : ISerializable { /// Initializes a new instance of the class with the specified URI. /// A URI. /// /// is null. /// /// is empty.-or- The scheme specified in is not correctly formed. See .-or- contains too many slashes.-or- The password specified in is not valid.-or- The host name specified in is not valid.-or- The file name specified in is not valid. -or- The user name specified in is not valid.-or- The host or authority name specified in cannot be terminated by backslashes.-or- The port number specified in is not valid or cannot be parsed.-or- The length of exceeds 65519 characters.-or- The length of the scheme specified in exceeds 1023 characters.-or- There is an invalid character sequence in .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B59 RID: 7001 RVA: 0x00064218 File Offset: 0x00062418 public Uri(string uriString) : this(uriString, false) { } /// Initializes a new instance of the class from the specified instances of the and classes. /// An instance of the class containing the information required to serialize the new instance. /// An instance of the class containing the source of the serialized stream associated with the new instance. /// The parameter contains a null URI. /// The parameter contains a URI that is empty.-or- The scheme specified is not correctly formed. See .-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:\\. // Token: 0x06001B5A RID: 7002 RVA: 0x00064224 File Offset: 0x00062424 protected Uri(SerializationInfo serializationInfo, StreamingContext streamingContext) : this(serializationInfo.GetString("AbsoluteUri"), true) { } /// Initializes a new instance of the class with the specified URI. This constructor allows you to specify if the URI string is a relative URI, absolute URI, or is indeterminate. /// A string that identifies the resource to be represented by the instance. /// Specifies whether the URI string is a relative URI, absolute URI, or is indeterminate. /// /// is invalid. /// /// is null. /// /// contains a relative URI and is .or contains an absolute URI and is .or is empty.-or- The scheme specified in is not correctly formed. See .-or- contains too many slashes.-or- The password specified in is not valid.-or- The host name specified in is not valid.-or- The file name specified in is not valid. -or- The user name specified in is not valid.-or- The host or authority name specified in cannot be terminated by backslashes.-or- The port number specified in is not valid or cannot be parsed.-or- The length of exceeds 65519 characters.-or- The length of the scheme specified in exceeds 1023 characters.-or- There is an invalid character sequence in .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B5B RID: 7003 RVA: 0x00064238 File Offset: 0x00062438 public Uri(string uriString, global::System.UriKind uriKind) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); this.source = uriString; this.ParseUri(uriKind); switch (uriKind) { case global::System.UriKind.RelativeOrAbsolute: break; case global::System.UriKind.Absolute: if (!this.IsAbsoluteUri) { throw new global::System.UriFormatException("Invalid URI: The format of the URI could not be determined."); } break; case global::System.UriKind.Relative: if (this.IsAbsoluteUri) { throw new global::System.UriFormatException("Invalid URI: The format of the URI could not be determined because the parameter 'uriString' represents an absolute URI."); } break; default: { string text = global::Locale.GetText("Invalid UriKind value '{0}'.", new object[] { uriKind }); throw new ArgumentException(text); } } } // Token: 0x06001B5C RID: 7004 RVA: 0x00064320 File Offset: 0x00062520 private Uri(string uriString, global::System.UriKind uriKind, out bool success) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); if (uriString == null) { success = false; return; } if (uriKind != global::System.UriKind.RelativeOrAbsolute && uriKind != global::System.UriKind.Absolute && uriKind != global::System.UriKind.Relative) { string text = global::Locale.GetText("Invalid UriKind value '{0}'.", new object[] { uriKind }); throw new ArgumentException(text); } this.source = uriString; if (this.ParseNoExceptions(uriKind, uriString) != null) { success = false; } else { success = true; switch (uriKind) { case global::System.UriKind.RelativeOrAbsolute: break; case global::System.UriKind.Absolute: if (!this.IsAbsoluteUri) { success = false; } break; case global::System.UriKind.Relative: if (this.IsAbsoluteUri) { success = false; } break; default: success = false; break; } } } /// Initializes a new instance of the class based on the combination of a specified base instance and a relative instance. /// An absolute that is the base for the new instance. /// A relative instance that is combined with . /// /// is null.-or- is not an absolute instance. /// /// is not an absolute instance. /// The URI formed by combining and is empty or contains only spaces.-or- The scheme specified in the URI formed by combining and is not valid.-or- The URI formed by combining and contains too many slashes.-or- The password specified in the URI formed by combining and is not valid.-or- The host name specified in the URI formed by combining and is not valid.-or- The file name specified in the URI formed by combining and is not valid. -or- The user name specified in the URI formed by combining and is not valid.-or- The host or authority name specified in the URI formed by combining and cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining and is not valid or cannot be parsed.-or- The length of the URI formed by combining and exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining and exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining and .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B5D RID: 7005 RVA: 0x00064430 File Offset: 0x00062630 public Uri(global::System.Uri baseUri, global::System.Uri relativeUri) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); this.Merge(baseUri, (!(relativeUri == null)) ? relativeUri.OriginalString : string.Empty); } /// Initializes a new instance of the class with the specified URI, with explicit control of character escaping. /// The URI. /// true if is completely escaped; otherwise, false. See Remarks. /// /// is null. /// /// is empty or contains only spaces.-or- The scheme specified in is not valid.-or- contains too many slashes.-or- The password specified in is not valid.-or- The host name specified in is not valid.-or- The file name specified in is not valid. -or- The user name specified in is not valid.-or- The host or authority name specified in cannot be terminated by backslashes.-or- The port number specified in is not valid or cannot be parsed.-or- The length of exceeds 65519 characters.-or- The length of the scheme specified in exceeds 1023 characters.-or- There is an invalid character sequence in .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B5E RID: 7006 RVA: 0x000644B8 File Offset: 0x000626B8 [Obsolete] public Uri(string uriString, bool dontEscape) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); this.userEscaped = dontEscape; this.source = uriString; this.ParseUri(global::System.UriKind.Absolute); if (!this.isAbsoluteUri) { throw new global::System.UriFormatException("Invalid URI: The format of the URI could not be determined: " + uriString); } } /// Initializes a new instance of the class based on the specified base URI and relative URI string. /// The base URI. /// The relative URI to add to the base URI. /// /// is null. /// /// is not an absolute instance. /// The URI formed by combining and is empty or contains only spaces.-or- The scheme specified in the URI formed by combining and is not valid.-or- The URI formed by combining and contains too many slashes.-or- The password specified in the URI formed by combining and is not valid.-or- The host name specified in the URI formed by combining and is not valid.-or- The file name specified in the URI formed by combining and is not valid. -or- The user name specified in the URI formed by combining and is not valid.-or- The host or authority name specified in the URI formed by combining and cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining and is not valid or cannot be parsed.-or- The length of the URI formed by combining and exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining and exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining and .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B5F RID: 7007 RVA: 0x0006454C File Offset: 0x0006274C public Uri(global::System.Uri baseUri, string relativeUri) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); this.Merge(baseUri, relativeUri); } /// Initializes a new instance of the class based on the specified base and relative URIs, with explicit control of character escaping. /// The base URI. /// The relative URI to add to the base URI. /// true if is completely escaped; otherwise, false. See Remarks. /// /// is null. /// /// is not an absolute instance. /// The URI formed by combining and is empty or contains only spaces.-or- The scheme specified in the URI formed by combining and is not valid.-or- The URI formed by combining and contains too many slashes.-or- The password specified in the URI formed by combining and is not valid.-or- The host name specified in the URI formed by combining and is not valid.-or- The file name specified in the URI formed by combining and is not valid. -or- The user name specified in the URI formed by combining and is not valid.-or- The host or authority name specified in the URI formed by combining and cannot be terminated by backslashes.-or- The port number specified in the URI formed by combining and is not valid or cannot be parsed.-or- The length of the URI formed by combining and exceeds 65519 characters.-or- The length of the scheme specified in the URI formed by combining and exceeds 1023 characters.-or- There is an invalid character sequence in the URI formed by combining and .-or- The MS-DOS path specified in must start with c:\\. // Token: 0x06001B60 RID: 7008 RVA: 0x000645B8 File Offset: 0x000627B8 [Obsolete("dontEscape is always false")] public Uri(global::System.Uri baseUri, string relativeUri, bool dontEscape) { this.scheme = string.Empty; this.host = string.Empty; this.port = -1; this.path = string.Empty; this.query = string.Empty; this.fragment = string.Empty; this.userinfo = string.Empty; this.isAbsoluteUri = true; base..ctor(); this.userEscaped = dontEscape; this.Merge(baseUri, relativeUri); } /// Returns the data needed to serialize the current instance. /// A object containing the information required to serialize the . /// A object containing the source and destination of the serialized stream associated with the . // Token: 0x06001B62 RID: 7010 RVA: 0x000647A8 File Offset: 0x000629A8 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("AbsoluteUri", this.AbsoluteUri); } // Token: 0x06001B63 RID: 7011 RVA: 0x000647BC File Offset: 0x000629BC private void Merge(global::System.Uri baseUri, string relativeUri) { if (baseUri == null) { throw new ArgumentNullException("baseUri"); } if (!baseUri.IsAbsoluteUri) { throw new ArgumentOutOfRangeException("baseUri"); } if (relativeUri == null) { relativeUri = string.Empty; } if (relativeUri.Length >= 2 && relativeUri[0] == '\\' && relativeUri[1] == '\\') { this.source = relativeUri; this.ParseUri(global::System.UriKind.Absolute); return; } int num = relativeUri.IndexOf(':'); if (num != -1) { int num2 = relativeUri.IndexOfAny(new char[] { '/', '\\', '?' }); if (num2 > num || num2 < 0) { if (string.CompareOrdinal(baseUri.Scheme, 0, relativeUri, 0, num) != 0 || !global::System.Uri.IsPredefinedScheme(baseUri.Scheme) || (relativeUri.Length > num + 1 && relativeUri[num + 1] == '/')) { this.source = relativeUri; this.ParseUri(global::System.UriKind.Absolute); return; } relativeUri = relativeUri.Substring(num + 1); } } this.scheme = baseUri.scheme; this.host = baseUri.host; this.port = baseUri.port; this.userinfo = baseUri.userinfo; this.isUnc = baseUri.isUnc; this.isUnixFilePath = baseUri.isUnixFilePath; this.isOpaquePart = baseUri.isOpaquePart; if (relativeUri == string.Empty) { this.path = baseUri.path; this.query = baseUri.query; this.fragment = baseUri.fragment; return; } num = relativeUri.IndexOf('#'); if (num != -1) { if (this.userEscaped) { this.fragment = relativeUri.Substring(num); } else { this.fragment = "#" + global::System.Uri.EscapeString(relativeUri.Substring(num + 1)); } relativeUri = relativeUri.Substring(0, num); } num = relativeUri.IndexOf('?'); if (num != -1) { this.query = relativeUri.Substring(num); if (!this.userEscaped) { this.query = global::System.Uri.EscapeString(this.query); } relativeUri = relativeUri.Substring(0, num); } if (relativeUri.Length > 0 && relativeUri[0] == '/') { if (relativeUri.Length > 1 && relativeUri[1] == '/') { this.source = this.scheme + ':' + relativeUri; this.ParseUri(global::System.UriKind.Absolute); return; } this.path = relativeUri; if (!this.userEscaped) { this.path = global::System.Uri.EscapeString(this.path); } return; } else { this.path = baseUri.path; if (relativeUri.Length > 0 || this.query.Length > 0) { num = this.path.LastIndexOf('/'); if (num >= 0) { this.path = this.path.Substring(0, num + 1); } } if (relativeUri.Length == 0) { return; } this.path += relativeUri; int num3 = 0; for (;;) { num = this.path.IndexOf("./", num3); if (num == -1) { break; } if (num == 0) { this.path = this.path.Remove(0, 2); } else if (this.path[num - 1] != '.') { this.path = this.path.Remove(num, 2); } else { num3 = num + 1; } } if (this.path.Length > 1 && this.path[this.path.Length - 1] == '.' && this.path[this.path.Length - 2] == '/') { this.path = this.path.Remove(this.path.Length - 1, 1); } num3 = 0; for (;;) { num = this.path.IndexOf("/../", num3); if (num == -1) { break; } if (num == 0) { num3 = 3; } else { int num4 = this.path.LastIndexOf('/', num - 1); if (num4 == -1) { num3 = num + 1; } else if (this.path.Substring(num4 + 1, num - num4 - 1) != "..") { this.path = this.path.Remove(num4 + 1, num - num4 + 3); } else { num3 = num + 1; } } } if (this.path.Length > 3 && this.path.EndsWith("/..")) { num = this.path.LastIndexOf('/', this.path.Length - 4); if (num != -1 && this.path.Substring(num + 1, this.path.Length - num - 4) != "..") { this.path = this.path.Remove(num + 1, this.path.Length - num - 1); } } if (!this.userEscaped) { this.path = global::System.Uri.EscapeString(this.path); } return; } } /// Gets the absolute path of the URI. /// A containing the absolute path to the resource. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000853 RID: 2131 // (get) Token: 0x06001B64 RID: 7012 RVA: 0x00064D08 File Offset: 0x00062F08 public string AbsolutePath { get { this.EnsureAbsoluteUri(); string text = this.Scheme; if (text != null) { if (global::System.Uri.<>f__switch$map12 == null) { global::System.Uri.<>f__switch$map12 = new Dictionary(2) { { "mailto", 0 }, { "file", 0 } }; } int num; if (global::System.Uri.<>f__switch$map12.TryGetValue(text, out num)) { if (num == 0) { return this.path; } } } if (this.path.Length != 0) { return this.path; } string text2 = this.Scheme + global::System.Uri.SchemeDelimiter; if (this.path.StartsWith(text2)) { return "/"; } return string.Empty; } } /// Gets the absolute URI. /// A containing the entire URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000854 RID: 2132 // (get) Token: 0x06001B65 RID: 7013 RVA: 0x00064DC0 File Offset: 0x00062FC0 public string AbsoluteUri { get { this.EnsureAbsoluteUri(); if (this.cachedAbsoluteUri == null) { this.cachedAbsoluteUri = this.GetLeftPart(global::System.UriPartial.Path); if (this.query.Length > 0) { this.cachedAbsoluteUri += this.query; } if (this.fragment.Length > 0) { this.cachedAbsoluteUri += this.fragment; } } return this.cachedAbsoluteUri; } } /// Gets the Domain Name System (DNS) host name or IP address and the port number for a server. /// A containing the authority component of the URI represented by this instance. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000855 RID: 2133 // (get) Token: 0x06001B66 RID: 7014 RVA: 0x00064E44 File Offset: 0x00063044 public string Authority { get { this.EnsureAbsoluteUri(); return (global::System.Uri.GetDefaultPort(this.Scheme) != this.port) ? (this.host + ":" + this.port) : this.host; } } /// Gets the escaped URI fragment. /// A that contains any URI fragment information. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x17000856 RID: 2134 // (get) Token: 0x06001B67 RID: 7015 RVA: 0x00064E94 File Offset: 0x00063094 public string Fragment { get { this.EnsureAbsoluteUri(); return this.fragment; } } /// Gets the host component of this instance. /// A that contains the host name. This is usually the DNS host name or IP address of the server. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000857 RID: 2135 // (get) Token: 0x06001B68 RID: 7016 RVA: 0x00064EA4 File Offset: 0x000630A4 public string Host { get { this.EnsureAbsoluteUri(); return this.host; } } /// Gets the type of the host name specified in the URI. /// A member of the enumeration. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000858 RID: 2136 // (get) Token: 0x06001B69 RID: 7017 RVA: 0x00064EB4 File Offset: 0x000630B4 public global::System.UriHostNameType HostNameType { get { this.EnsureAbsoluteUri(); global::System.UriHostNameType uriHostNameType = global::System.Uri.CheckHostName(this.Host); if (uriHostNameType != global::System.UriHostNameType.Unknown) { return uriHostNameType; } string text = this.Scheme; if (text != null) { if (global::System.Uri.<>f__switch$map13 == null) { global::System.Uri.<>f__switch$map13 = new Dictionary(1) { { "mailto", 0 } }; } int num; if (global::System.Uri.<>f__switch$map13.TryGetValue(text, out num)) { if (num == 0) { return global::System.UriHostNameType.Basic; } } } return (!this.IsFile) ? uriHostNameType : global::System.UriHostNameType.Basic; } } /// Gets whether the port value of the URI is the default for this scheme. /// A value that is true if the value in the property is the default port for this scheme; otherwise, false. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000859 RID: 2137 // (get) Token: 0x06001B6A RID: 7018 RVA: 0x00064F3C File Offset: 0x0006313C public bool IsDefaultPort { get { this.EnsureAbsoluteUri(); return global::System.Uri.GetDefaultPort(this.Scheme) == this.port; } } /// Gets a value indicating whether the specified is a file URI. /// A value that is true if the is a file URI; otherwise, false. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x1700085A RID: 2138 // (get) Token: 0x06001B6B RID: 7019 RVA: 0x00064F58 File Offset: 0x00063158 public bool IsFile { get { this.EnsureAbsoluteUri(); return this.Scheme == global::System.Uri.UriSchemeFile; } } /// Gets whether the specified references the local host. /// A value that is true if this references the local host; otherwise, false. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x1700085B RID: 2139 // (get) Token: 0x06001B6C RID: 7020 RVA: 0x00064F70 File Offset: 0x00063170 public bool IsLoopback { get { this.EnsureAbsoluteUri(); if (this.Host.Length == 0) { return this.IsFile; } global::System.Net.IPAddress ipaddress; global::System.Net.IPv6Address pv6Address; return this.host == "loopback" || this.host == "localhost" || (global::System.Net.IPAddress.TryParse(this.host, out ipaddress) && global::System.Net.IPAddress.Loopback.Equals(ipaddress)) || (global::System.Net.IPv6Address.TryParse(this.host, out pv6Address) && global::System.Net.IPv6Address.IsLoopback(pv6Address)); } } /// Gets whether the specified is a universal naming convention (UNC) path. /// A value that is true if the is a UNC path; otherwise, false. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x1700085C RID: 2140 // (get) Token: 0x06001B6D RID: 7021 RVA: 0x0006500C File Offset: 0x0006320C public bool IsUnc { get { this.EnsureAbsoluteUri(); return this.isUnc; } } /// Gets a local operating-system representation of a file name. /// A that contains the local operating-system representation of a file name. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x1700085D RID: 2141 // (get) Token: 0x06001B6E RID: 7022 RVA: 0x0006501C File Offset: 0x0006321C public string LocalPath { get { this.EnsureAbsoluteUri(); if (this.cachedLocalPath != null) { return this.cachedLocalPath; } if (!this.IsFile) { return this.AbsolutePath; } bool flag = this.path.Length > 3 && this.path[1] == ':' && (this.path[2] == '\\' || this.path[2] == '/'); if (!this.IsUnc) { string text = this.Unescape(this.path); bool flag2 = flag; if (flag2) { this.cachedLocalPath = text.Replace('/', '\\'); } else { this.cachedLocalPath = text; } } else if (this.path.Length > 1 && this.path[1] == ':') { this.cachedLocalPath = this.Unescape(this.path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); } else if (Path.DirectorySeparatorChar == '\\') { string text2 = this.host; if (this.path.Length > 0 && (this.path.Length > 1 || this.path[0] != '/')) { text2 += this.path.Replace('/', '\\'); } this.cachedLocalPath = "\\\\" + this.Unescape(text2); } else { this.cachedLocalPath = this.Unescape(this.path); } if (this.cachedLocalPath.Length == 0) { this.cachedLocalPath = Path.DirectorySeparatorChar.ToString(); } return this.cachedLocalPath; } } /// Gets the and properties separated by a question mark (?). /// A that contains the and properties separated by a question mark (?). /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x1700085E RID: 2142 // (get) Token: 0x06001B6F RID: 7023 RVA: 0x000651E4 File Offset: 0x000633E4 public string PathAndQuery { get { this.EnsureAbsoluteUri(); return this.path + this.Query; } } /// Gets the port number of this URI. /// An value that contains the port number for this URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x1700085F RID: 2143 // (get) Token: 0x06001B70 RID: 7024 RVA: 0x00065200 File Offset: 0x00063400 public int Port { get { this.EnsureAbsoluteUri(); return this.port; } } /// Gets any query information included in the specified URI. /// A that contains any query information included in the specified URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x17000860 RID: 2144 // (get) Token: 0x06001B71 RID: 7025 RVA: 0x00065210 File Offset: 0x00063410 public string Query { get { this.EnsureAbsoluteUri(); return this.query; } } /// Gets the scheme name for this URI. /// A that contains the scheme for this URI, converted to lowercase. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x17000861 RID: 2145 // (get) Token: 0x06001B72 RID: 7026 RVA: 0x00065220 File Offset: 0x00063420 public string Scheme { get { this.EnsureAbsoluteUri(); return this.scheme; } } /// Gets an array containing the path segments that make up the specified URI. /// A array that contains the path segments that make up the specified URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x17000862 RID: 2146 // (get) Token: 0x06001B73 RID: 7027 RVA: 0x00065230 File Offset: 0x00063430 public string[] Segments { get { this.EnsureAbsoluteUri(); if (this.segments != null) { return this.segments; } if (this.path.Length == 0) { this.segments = new string[0]; return this.segments; } string[] array = this.path.Split(new char[] { '/' }); this.segments = array; bool flag = this.path.EndsWith("/"); if (array.Length > 0 && flag) { string[] array2 = new string[array.Length - 1]; Array.Copy(array, 0, array2, 0, array.Length - 1); array = array2; } int i = 0; if (this.IsFile && this.path.Length > 1 && this.path[1] == ':') { string[] array3 = new string[array.Length + 1]; Array.Copy(array, 1, array3, 2, array.Length - 1); array = array3; array[0] = this.path.Substring(0, 2); array[1] = string.Empty; i++; } int num = array.Length; while (i < num) { if (i != num - 1 || flag) { string[] array4 = array; int num2 = i; array4[num2] += '/'; } i++; } this.segments = array; return this.segments; } } /// Indicates that the URI string was completely escaped before the instance was created. /// A value that is true if the parameter was set to true when the instance was created; otherwise, false. /// 2 // Token: 0x17000863 RID: 2147 // (get) Token: 0x06001B74 RID: 7028 RVA: 0x00065388 File Offset: 0x00063588 public bool UserEscaped { get { return this.userEscaped; } } /// Gets the user name, password, or other user-specific information associated with the specified URI. /// A that contains the user information associated with the URI. The returned value does not include the '@' character reserved for delimiting the user information part of the URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000864 RID: 2148 // (get) Token: 0x06001B75 RID: 7029 RVA: 0x00065390 File Offset: 0x00063590 public string UserInfo { get { this.EnsureAbsoluteUri(); return this.userinfo; } } /// Gets an unescaped host name that is safe to use for DNS resolution. /// A that contains the unescaped host part of the URI that is suitable for DNS resolution; or the original unescaped host string, if it is already suitable for resolution. /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x17000865 RID: 2149 // (get) Token: 0x06001B76 RID: 7030 RVA: 0x000653A0 File Offset: 0x000635A0 [global::System.MonoTODO("add support for IPv6 address")] public string DnsSafeHost { get { this.EnsureAbsoluteUri(); return this.Unescape(this.Host); } } /// Gets whether the instance is absolute. /// A value that is true if the instance is absolute; otherwise, false. /// 1 // Token: 0x17000866 RID: 2150 // (get) Token: 0x06001B77 RID: 7031 RVA: 0x000653B4 File Offset: 0x000635B4 public bool IsAbsoluteUri { get { return this.isAbsoluteUri; } } /// Gets the original URI string that was passed to the constructor. /// A containing the exact URI specified when this instance was constructed; otherwise, . /// This instance represents a relative URI, and this property is valid only for absolute URIs. /// 1 /// /// /// // Token: 0x17000867 RID: 2151 // (get) Token: 0x06001B78 RID: 7032 RVA: 0x000653BC File Offset: 0x000635BC public string OriginalString { get { return (this.source == null) ? this.ToString() : this.source; } } /// Determines whether the specified host name is a valid DNS name. /// A that indicates the type of the host name. If the type of the host name cannot be determined or if the host name is null or a zero-length string, this method returns . /// The host name to validate. This can be an IPv4 or IPv6 address or an Internet host name. /// 1 // Token: 0x06001B79 RID: 7033 RVA: 0x000653DC File Offset: 0x000635DC public static global::System.UriHostNameType CheckHostName(string name) { if (name == null || name.Length == 0) { return global::System.UriHostNameType.Unknown; } if (global::System.Uri.IsIPv4Address(name)) { return global::System.UriHostNameType.IPv4; } if (global::System.Uri.IsDomainAddress(name)) { return global::System.UriHostNameType.Dns; } global::System.Net.IPv6Address pv6Address; if (global::System.Net.IPv6Address.TryParse(name, out pv6Address)) { return global::System.UriHostNameType.IPv6; } return global::System.UriHostNameType.Unknown; } // Token: 0x06001B7A RID: 7034 RVA: 0x00065428 File Offset: 0x00063628 internal static bool IsIPv4Address(string name) { string[] array = name.Split(new char[] { '.' }); if (array.Length != 4) { return false; } for (int i = 0; i < 4; i++) { if (array[i].Length == 0) { return false; } uint num; if (!uint.TryParse(array[i], out num)) { return false; } if (num > 255U) { return false; } } return true; } // Token: 0x06001B7B RID: 7035 RVA: 0x00065494 File Offset: 0x00063694 internal static bool IsDomainAddress(string name) { int length = name.Length; int num = 0; for (int i = 0; i < length; i++) { char c = name[i]; if (num == 0) { if (!char.IsLetterOrDigit(c)) { return false; } } else if (c == '.') { num = 0; } else if (!char.IsLetterOrDigit(c) && c != '-' && c != '_') { return false; } if (++num == 64) { return false; } } return true; } /// Determines whether the specified scheme name is valid. /// A value that is true if the scheme name is valid; otherwise, false. /// The scheme name to validate. /// 1 // Token: 0x06001B7C RID: 7036 RVA: 0x00065518 File Offset: 0x00063718 public static bool CheckSchemeName(string schemeName) { if (schemeName == null || schemeName.Length == 0) { return false; } if (!global::System.Uri.IsAlpha(schemeName[0])) { return false; } int length = schemeName.Length; for (int i = 1; i < length; i++) { char c = schemeName[i]; if (!char.IsDigit(c) && !global::System.Uri.IsAlpha(c) && c != '.' && c != '+' && c != '-') { return false; } } return true; } // Token: 0x06001B7D RID: 7037 RVA: 0x000655A0 File Offset: 0x000637A0 private static bool IsAlpha(char c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); } /// Compares two instances for equality. /// A value that is true if the two instances represent the same URI; otherwise, false. /// The instance or a URI identifier to compare with the current instance. /// 2 // Token: 0x06001B7E RID: 7038 RVA: 0x000655D8 File Offset: 0x000637D8 public override bool Equals(object comparant) { if (comparant == null) { return false; } global::System.Uri uri = comparant as global::System.Uri; if (uri == null) { string text = comparant as string; if (text == null) { return false; } uri = new global::System.Uri(text); } return this.InternalEquals(uri); } // Token: 0x06001B7F RID: 7039 RVA: 0x00065618 File Offset: 0x00063818 private bool InternalEquals(global::System.Uri uri) { if (this.isAbsoluteUri != uri.isAbsoluteUri) { return false; } if (!this.isAbsoluteUri) { return this.source == uri.source; } CultureInfo invariantCulture = CultureInfo.InvariantCulture; return this.scheme.ToLower(invariantCulture) == uri.scheme.ToLower(invariantCulture) && this.host.ToLower(invariantCulture) == uri.host.ToLower(invariantCulture) && this.port == uri.port && this.query == uri.query && this.path == uri.path; } /// Gets the hash code for the URI. /// An containing the hash value generated for this URI. /// 2 /// /// /// // Token: 0x06001B80 RID: 7040 RVA: 0x000656DC File Offset: 0x000638DC public override int GetHashCode() { if (this.cachedHashCode == 0) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; if (this.isAbsoluteUri) { this.cachedHashCode = this.scheme.ToLower(invariantCulture).GetHashCode() ^ this.host.ToLower(invariantCulture).GetHashCode() ^ this.port ^ this.query.GetHashCode() ^ this.path.GetHashCode(); } else { this.cachedHashCode = this.source.GetHashCode(); } } return this.cachedHashCode; } /// Gets the specified portion of a instance. /// A that contains the specified portion of the instance. /// One of the values that specifies the end of the URI portion to return. /// The current instance is not an absolute instance. /// The specified is not valid. /// 2 /// /// /// // Token: 0x06001B81 RID: 7041 RVA: 0x0006576C File Offset: 0x0006396C public string GetLeftPart(global::System.UriPartial part) { this.EnsureAbsoluteUri(); switch (part) { case global::System.UriPartial.Scheme: return this.scheme + this.GetOpaqueWiseSchemeDelimiter(); case global::System.UriPartial.Authority: { if (this.scheme == global::System.Uri.UriSchemeMailto || this.scheme == global::System.Uri.UriSchemeNews) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(this.scheme); stringBuilder.Append(this.GetOpaqueWiseSchemeDelimiter()); if (this.path.Length > 1 && this.path[1] == ':' && global::System.Uri.UriSchemeFile == this.scheme) { stringBuilder.Append('/'); } if (this.userinfo.Length > 0) { stringBuilder.Append(this.userinfo).Append('@'); } stringBuilder.Append(this.host); int num = global::System.Uri.GetDefaultPort(this.scheme); if (this.port != -1 && this.port != num) { stringBuilder.Append(':').Append(this.port); } return stringBuilder.ToString(); } case global::System.UriPartial.Path: { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append(this.scheme); stringBuilder2.Append(this.GetOpaqueWiseSchemeDelimiter()); if (this.path.Length > 1 && this.path[1] == ':' && global::System.Uri.UriSchemeFile == this.scheme) { stringBuilder2.Append('/'); } if (this.userinfo.Length > 0) { stringBuilder2.Append(this.userinfo).Append('@'); } stringBuilder2.Append(this.host); int num = global::System.Uri.GetDefaultPort(this.scheme); if (this.port != -1 && this.port != num) { stringBuilder2.Append(':').Append(this.port); } if (this.path.Length > 0) { string text = this.Scheme; if (text != null) { if (global::System.Uri.<>f__switch$map14 == null) { global::System.Uri.<>f__switch$map14 = new Dictionary(2) { { "mailto", 0 }, { "news", 0 } }; } int num2; if (global::System.Uri.<>f__switch$map14.TryGetValue(text, out num2)) { if (num2 == 0) { stringBuilder2.Append(this.path); goto IL_2A6; } } } stringBuilder2.Append(global::System.Uri.Reduce(this.path, global::System.Uri.CompactEscaped(this.Scheme))); } IL_2A6: return stringBuilder2.ToString(); } default: return null; } } /// Gets the decimal value of a hexadecimal digit. /// An value that contains a number from 0 to 15 that corresponds to the specified hexadecimal digit. /// The hexadecimal digit (0-9, a-f, A-F) to convert. /// /// is not a valid hexadecimal digit (0-9, a-f, A-F). /// 1 // Token: 0x06001B82 RID: 7042 RVA: 0x00065A28 File Offset: 0x00063C28 public static int FromHex(char digit) { if ('0' <= digit && digit <= '9') { return (int)(digit - '0'); } if ('a' <= digit && digit <= 'f') { return (int)(digit - 'a' + '\n'); } if ('A' <= digit && digit <= 'F') { return (int)(digit - 'A' + '\n'); } throw new ArgumentException("digit"); } /// Converts a specified character into its hexadecimal equivalent. /// The hexadecimal representation of the specified character. /// The character to convert to hexadecimal representation. /// /// is greater than 255. /// 1 // Token: 0x06001B83 RID: 7043 RVA: 0x00065A84 File Offset: 0x00063C84 public static string HexEscape(char character) { if (character > 'ÿ') { throw new ArgumentOutOfRangeException("character"); } return "%" + global::System.Uri.hexUpperChars[(int)((character & 'ð') >> 4)] + global::System.Uri.hexUpperChars[(int)(character & '\u000f')]; } /// Converts a specified hexadecimal representation of a character to the character. /// The character represented by the hexadecimal encoding at position . If the character at is not hexadecimal encoded, the character at is returned. The value of is incremented to point to the character following the one returned. /// The hexadecimal representation of a character. /// The location in where the hexadecimal representation of a character begins. /// /// is less than 0 or greater than or equal to the number of characters in . /// 1 // Token: 0x06001B84 RID: 7044 RVA: 0x00065ADC File Offset: 0x00063CDC public static char HexUnescape(string pattern, ref int index) { if (pattern == null) { throw new ArgumentException("pattern"); } if (index < 0 || index >= pattern.Length) { throw new ArgumentOutOfRangeException("index"); } if (!global::System.Uri.IsHexEncoding(pattern, index)) { return pattern[index++]; } index++; int num = global::System.Uri.FromHex(pattern[index++]); int num2 = global::System.Uri.FromHex(pattern[index++]); return (char)((num << 4) | num2); } /// Determines whether a specified character is a valid hexadecimal digit. /// A value that is true if the character is a valid hexadecimal digit; otherwise false. /// The character to validate. /// 1 // Token: 0x06001B85 RID: 7045 RVA: 0x00065B70 File Offset: 0x00063D70 public static bool IsHexDigit(char digit) { return ('0' <= digit && digit <= '9') || ('a' <= digit && digit <= 'f') || ('A' <= digit && digit <= 'F'); } /// Determines whether a character in a string is hexadecimal encoded. /// A value that is true if is hexadecimal encoded at the specified location; otherwise, false. /// The string to check. /// The location in to check for hexadecimal encoding. /// 1 // Token: 0x06001B86 RID: 7046 RVA: 0x00065BB4 File Offset: 0x00063DB4 public static bool IsHexEncoding(string pattern, int index) { return index + 3 <= pattern.Length && (pattern[index++] == '%' && global::System.Uri.IsHexDigit(pattern[index++])) && global::System.Uri.IsHexDigit(pattern[index]); } /// Determines the difference between two instances. /// If the hostname and scheme of this URI instance and are the same, then this method returns a relative that, when appended to the current URI instance, yields .If the hostname or scheme is different, then this method returns a that represents the parameter. /// The URI to compare to the current URI. /// This instance represents a relative URI, and this property is valid only for absolute URIs. // Token: 0x06001B87 RID: 7047 RVA: 0x00065C0C File Offset: 0x00063E0C public global::System.Uri MakeRelativeUri(global::System.Uri uri) { if (uri == null) { throw new ArgumentNullException("uri"); } if (this.Host != uri.Host || this.Scheme != uri.Scheme) { return uri; } string text = string.Empty; if (this.path != uri.path) { string[] array = this.Segments; string[] array2 = uri.Segments; int i = 0; int num = Math.Min(array.Length, array2.Length); while (i < num) { if (array[i] != array2[i]) { break; } i++; } for (int j = i + 1; j < array.Length; j++) { text += "../"; } for (int k = i; k < array2.Length; k++) { text += array2[k]; } } uri.AppendQueryAndFragment(ref text); return new global::System.Uri(text, global::System.UriKind.Relative); } /// Determines the difference between two instances. /// If the hostname and scheme of this URI instance and are the same, then this method returns a that represents a relative URI that, when appended to the current URI instance, yields the parameter.If the hostname or scheme is different, then this method returns a that represents the parameter. /// The URI to compare to the current URI. /// This instance represents a relative URI, and this method is valid only for absolute URIs. /// 2 /// /// /// // Token: 0x06001B88 RID: 7048 RVA: 0x00065D18 File Offset: 0x00063F18 [Obsolete("Use MakeRelativeUri(Uri uri) instead.")] public string MakeRelative(global::System.Uri toUri) { if (this.Scheme != toUri.Scheme || this.Authority != toUri.Authority) { return toUri.ToString(); } string text = string.Empty; if (this.path != toUri.path) { string[] array = this.Segments; string[] array2 = toUri.Segments; int i = 0; int num = Math.Min(array.Length, array2.Length); while (i < num) { if (array[i] != array2[i]) { break; } i++; } for (int j = i + 1; j < array.Length; j++) { text += "../"; } for (int k = i; k < array2.Length; k++) { text += array2[k]; } } return text; } // Token: 0x06001B89 RID: 7049 RVA: 0x00065E04 File Offset: 0x00064004 private void AppendQueryAndFragment(ref string result) { if (this.query.Length > 0) { string text = ((this.query[0] != '?') ? global::System.Uri.Unescape(this.query, false) : ('?' + global::System.Uri.Unescape(this.query.Substring(1), false))); result += text; } if (this.fragment.Length > 0) { result += this.fragment; } } /// Gets a canonical string representation for the specified instance. /// A instance that contains the unescaped canonical representation of the instance. All characters are unescaped except #, ?, and %. /// 2 /// /// /// // Token: 0x06001B8A RID: 7050 RVA: 0x00065E90 File Offset: 0x00064090 public override string ToString() { if (this.cachedToString != null) { return this.cachedToString; } if (this.isAbsoluteUri) { this.cachedToString = global::System.Uri.Unescape(this.GetLeftPart(global::System.UriPartial.Path), true); } else { this.cachedToString = this.Unescape(this.path); } this.AppendQueryAndFragment(ref this.cachedToString); return this.cachedToString; } /// Returns the data needed to serialize the current instance. /// A object containing the information required to serialize the . /// A object containing the source and destination of the serialized stream associated with the . // Token: 0x06001B8B RID: 7051 RVA: 0x00065EF8 File Offset: 0x000640F8 protected void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("AbsoluteUri", this.AbsoluteUri); } /// Converts any unsafe or reserved characters in the path component to their hexadecimal character representations. /// The URI passed from the constructor is invalid. This exception can occur if a URI has too many characters or the URI is relative. // Token: 0x06001B8C RID: 7052 RVA: 0x00065F0C File Offset: 0x0006410C [Obsolete] protected virtual void Escape() { this.path = global::System.Uri.EscapeString(this.path); } /// Converts a string to its escaped representation. /// The escaped representation of the string. /// The string to transform to its escaped representation. // Token: 0x06001B8D RID: 7053 RVA: 0x00065F20 File Offset: 0x00064120 [Obsolete] protected static string EscapeString(string str) { return global::System.Uri.EscapeString(str, false, true, true); } // Token: 0x06001B8E RID: 7054 RVA: 0x00065F2C File Offset: 0x0006412C internal static string EscapeString(string str, bool escapeReserved, bool escapeHex, bool escapeBrackets) { if (str == null) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(); int length = str.Length; for (int i = 0; i < length; i++) { if (global::System.Uri.IsHexEncoding(str, i)) { stringBuilder.Append(str.Substring(i, 3)); i += 2; } else { byte[] bytes = Encoding.UTF8.GetBytes(new char[] { str[i] }); int num = bytes.Length; for (int j = 0; j < num; j++) { char c = (char)bytes[j]; if (c <= ' ' || c >= '\u007f' || "<>%\"{}|\\^`".IndexOf(c) != -1 || (escapeHex && c == '#') || (escapeBrackets && (c == '[' || c == ']')) || (escapeReserved && ";/?:@&=+$,".IndexOf(c) != -1)) { stringBuilder.Append(global::System.Uri.HexEscape(c)); } else { stringBuilder.Append(c); } } } } return stringBuilder.ToString(); } /// Parses the URI of the current instance to ensure it contains all the parts required for a valid URI. /// The Uri passed from the constructor is invalid. // Token: 0x06001B8F RID: 7055 RVA: 0x0006604C File Offset: 0x0006424C [Obsolete("The method has been deprecated. It is not used by the system.")] protected virtual void Parse() { } // Token: 0x06001B90 RID: 7056 RVA: 0x00066050 File Offset: 0x00064250 private void ParseUri(global::System.UriKind kind) { this.Parse(kind, this.source); if (this.userEscaped) { return; } this.host = global::System.Uri.EscapeString(this.host, false, true, false); if (this.host.Length > 1 && this.host[0] != '[' && this.host[this.host.Length - 1] != ']') { this.host = this.host.ToLower(CultureInfo.InvariantCulture); } if (this.path.Length > 0) { this.path = global::System.Uri.EscapeString(this.path); } } /// Converts the specified string by replacing any escape sequences with their unescaped representation. /// A that contains the unescaped value of the parameter. /// The to convert. // Token: 0x06001B91 RID: 7057 RVA: 0x00066108 File Offset: 0x00064308 [Obsolete] protected virtual string Unescape(string str) { return global::System.Uri.Unescape(str, false); } // Token: 0x06001B92 RID: 7058 RVA: 0x00066114 File Offset: 0x00064314 internal static string Unescape(string str, bool excludeSpecial) { if (str == null) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(); int length = str.Length; for (int i = 0; i < length; i++) { char c = str[i]; if (c == '%') { char c3; char c2 = global::System.Uri.HexUnescapeMultiByte(str, ref i, out c3); if (excludeSpecial && c2 == '#') { stringBuilder.Append("%23"); } else if (excludeSpecial && c2 == '%') { stringBuilder.Append("%25"); } else if (excludeSpecial && c2 == '?') { stringBuilder.Append("%3F"); } else { stringBuilder.Append(c2); if (c3 != '\0') { stringBuilder.Append(c3); } } i--; } else { stringBuilder.Append(c); } } return stringBuilder.ToString(); } // Token: 0x06001B93 RID: 7059 RVA: 0x000661F8 File Offset: 0x000643F8 private void ParseAsWindowsUNC(string uriString) { this.scheme = global::System.Uri.UriSchemeFile; this.port = -1; this.fragment = string.Empty; this.query = string.Empty; this.isUnc = true; uriString = uriString.TrimStart(new char[] { '\\' }); int num = uriString.IndexOf('\\'); if (num > 0) { this.path = uriString.Substring(num); this.host = uriString.Substring(0, num); } else { this.host = uriString; this.path = string.Empty; } this.path = this.path.Replace("\\", "/"); } // Token: 0x06001B94 RID: 7060 RVA: 0x000662A4 File Offset: 0x000644A4 private string ParseAsWindowsAbsoluteFilePath(string uriString) { if (uriString.Length > 2 && uriString[2] != '\\' && uriString[2] != '/') { return "Relative file path is not allowed."; } this.scheme = global::System.Uri.UriSchemeFile; this.host = string.Empty; this.port = -1; this.path = uriString.Replace("\\", "/"); this.fragment = string.Empty; this.query = string.Empty; return null; } // Token: 0x06001B95 RID: 7061 RVA: 0x0006632C File Offset: 0x0006452C private void ParseAsUnixAbsoluteFilePath(string uriString) { this.isUnixFilePath = true; this.scheme = global::System.Uri.UriSchemeFile; this.port = -1; this.fragment = string.Empty; this.query = string.Empty; this.host = string.Empty; this.path = null; if (uriString.Length >= 2 && uriString[0] == '/' && uriString[1] == '/') { uriString = uriString.TrimStart(new char[] { '/' }); this.path = '/' + uriString; } if (this.path == null) { this.path = uriString; } } // Token: 0x06001B96 RID: 7062 RVA: 0x000663DC File Offset: 0x000645DC private void Parse(global::System.UriKind kind, string uriString) { if (uriString == null) { throw new ArgumentNullException("uriString"); } string text = this.ParseNoExceptions(kind, uriString); if (text != null) { throw new global::System.UriFormatException(text); } } // Token: 0x06001B97 RID: 7063 RVA: 0x00066410 File Offset: 0x00064610 private string ParseNoExceptions(global::System.UriKind kind, string uriString) { uriString = uriString.Trim(); int length = uriString.Length; if (length == 0 && (kind == global::System.UriKind.Relative || kind == global::System.UriKind.RelativeOrAbsolute)) { this.isAbsoluteUri = false; return null; } if (length <= 1 && kind != global::System.UriKind.Relative) { return "Absolute URI is too short"; } int num = uriString.IndexOf(':'); if (num == 0) { return "Invalid URI: The format of the URI could not be determined."; } if (num < 0) { if (uriString[0] == '/' && Path.DirectorySeparatorChar == '/') { this.ParseAsUnixAbsoluteFilePath(uriString); if (kind == global::System.UriKind.Relative) { this.isAbsoluteUri = false; } } else if (uriString.Length >= 2 && uriString[0] == '\\' && uriString[1] == '\\') { this.ParseAsWindowsUNC(uriString); } else { this.isAbsoluteUri = false; this.path = uriString; } return null; } if (num == 1) { if (!global::System.Uri.IsAlpha(uriString[0])) { return "URI scheme must start with a letter."; } string text = this.ParseAsWindowsAbsoluteFilePath(uriString); if (text != null) { return text; } return null; } else { this.scheme = uriString.Substring(0, num).ToLower(CultureInfo.InvariantCulture); if (!global::System.Uri.CheckSchemeName(this.scheme)) { return global::Locale.GetText("URI scheme must start with a letter and must consist of one of alphabet, digits, '+', '-' or '.' character."); } int num2 = num + 1; int num3 = uriString.Length; num = uriString.IndexOf('#', num2); if (!this.IsUnc && num != -1) { if (this.userEscaped) { this.fragment = uriString.Substring(num); } else { this.fragment = "#" + global::System.Uri.EscapeString(uriString.Substring(num + 1)); } num3 = num; } num = uriString.IndexOf('?', num2, num3 - num2); if (num != -1) { this.query = uriString.Substring(num, num3 - num); num3 = num; if (!this.userEscaped) { this.query = global::System.Uri.EscapeString(this.query); } } if (global::System.Uri.IsPredefinedScheme(this.scheme) && this.scheme != global::System.Uri.UriSchemeMailto && this.scheme != global::System.Uri.UriSchemeNews && (num3 - num2 < 2 || (num3 - num2 >= 2 && uriString[num2] == '/' && uriString[num2 + 1] != '/'))) { return "Invalid URI: The Authority/Host could not be parsed."; } bool flag = num3 - num2 >= 2 && uriString[num2] == '/' && uriString[num2 + 1] == '/'; bool flag2 = this.scheme == global::System.Uri.UriSchemeFile && flag && (num3 - num2 == 2 || uriString[num2 + 2] == '/'); bool flag3 = false; if (flag) { if (kind == global::System.UriKind.Relative) { return "Absolute URI when we expected a relative one"; } if (this.scheme != global::System.Uri.UriSchemeMailto && this.scheme != global::System.Uri.UriSchemeNews) { num2 += 2; } if (this.scheme == global::System.Uri.UriSchemeFile) { int num4 = 2; for (int i = num2; i < num3; i++) { if (uriString[i] != '/') { break; } num4++; } if (num4 >= 4) { flag2 = false; while (num2 < num3 && uriString[num2] == '/') { num2++; } } else if (num4 >= 3) { num2++; } } if (num3 - num2 > 1 && uriString[num2 + 1] == ':') { flag2 = false; flag3 = true; } } else if (!global::System.Uri.IsPredefinedScheme(this.scheme)) { this.path = uriString.Substring(num2, num3 - num2); this.isOpaquePart = true; return null; } if (flag2) { num = -1; } else { num = uriString.IndexOf('/', num2, num3 - num2); if (num == -1 && flag3) { num = uriString.IndexOf('\\', num2, num3 - num2); } } if (num == -1) { if (this.scheme != global::System.Uri.UriSchemeMailto && this.scheme != global::System.Uri.UriSchemeNews) { this.path = "/"; } } else { this.path = uriString.Substring(num, num3 - num); num3 = num; } if (flag2) { num = -1; } else { num = uriString.IndexOf('@', num2, num3 - num2); } if (num != -1) { this.userinfo = uriString.Substring(num2, num - num2); num2 = num + 1; } this.port = -1; if (flag2) { num = -1; } else { num = uriString.LastIndexOf(':', num3 - 1, num3 - num2); } if (num != -1 && num != num3 - 1) { string text2 = uriString.Substring(num + 1, num3 - (num + 1)); if (text2.Length > 0 && text2[text2.Length - 1] != ']') { if (!int.TryParse(text2, NumberStyles.Integer, CultureInfo.InvariantCulture, out this.port) || this.port < 0 || this.port > 65535) { return "Invalid URI: Invalid port number"; } num3 = num; } else if (this.port == -1) { this.port = global::System.Uri.GetDefaultPort(this.scheme); } } else if (this.port == -1) { this.port = global::System.Uri.GetDefaultPort(this.scheme); } uriString = uriString.Substring(num2, num3 - num2); this.host = uriString; if (flag2) { this.path = global::System.Uri.Reduce('/' + uriString, true); this.host = string.Empty; } else if (this.host.Length == 2 && this.host[1] == ':') { this.path = this.host + this.path; this.host = string.Empty; } else if (this.isUnixFilePath) { uriString = "//" + uriString; this.host = string.Empty; } else if (this.scheme == global::System.Uri.UriSchemeFile) { this.isUnc = true; } else if (this.scheme == global::System.Uri.UriSchemeNews) { if (this.host.Length > 0) { this.path = this.host; this.host = string.Empty; } } else if (this.host.Length == 0 && (this.scheme == global::System.Uri.UriSchemeHttp || this.scheme == global::System.Uri.UriSchemeGopher || this.scheme == global::System.Uri.UriSchemeNntp || this.scheme == global::System.Uri.UriSchemeHttps || this.scheme == global::System.Uri.UriSchemeFtp)) { return "Invalid URI: The hostname could not be parsed"; } bool flag4 = this.host.Length > 0 && global::System.Uri.CheckHostName(this.host) == global::System.UriHostNameType.Unknown; if (!flag4 && this.host.Length > 1 && this.host[0] == '[' && this.host[this.host.Length - 1] == ']') { global::System.Net.IPv6Address pv6Address; if (global::System.Net.IPv6Address.TryParse(this.host, out pv6Address)) { this.host = "[" + pv6Address.ToString(true) + "]"; } else { flag4 = true; } } if (flag4 && (this.Parser is global::System.DefaultUriParser || this.Parser == null)) { return global::Locale.GetText("Invalid URI: The hostname could not be parsed. (" + this.host + ")"); } global::System.UriFormatException ex = null; if (this.Parser != null) { this.Parser.InitializeAndValidate(this, out ex); } if (ex != null) { return ex.Message; } if (this.scheme != global::System.Uri.UriSchemeMailto && this.scheme != global::System.Uri.UriSchemeNews && this.scheme != global::System.Uri.UriSchemeFile) { this.path = global::System.Uri.Reduce(this.path, global::System.Uri.CompactEscaped(this.scheme)); } return null; } } // Token: 0x06001B98 RID: 7064 RVA: 0x00066CA4 File Offset: 0x00064EA4 private static bool CompactEscaped(string scheme) { if (scheme != null) { if (global::System.Uri.<>f__switch$map15 == null) { global::System.Uri.<>f__switch$map15 = new Dictionary(5) { { "file", 0 }, { "http", 0 }, { "https", 0 }, { "net.pipe", 0 }, { "net.tcp", 0 } }; } int num; if (global::System.Uri.<>f__switch$map15.TryGetValue(scheme, out num)) { if (num == 0) { return true; } } } return false; } // Token: 0x06001B99 RID: 7065 RVA: 0x00066D2C File Offset: 0x00064F2C private static string Reduce(string path, bool compact_escaped) { if (path == "/") { return path; } StringBuilder stringBuilder = new StringBuilder(); if (compact_escaped) { for (int i = 0; i < path.Length; i++) { char c = path[i]; char c2 = c; if (c2 != '%') { if (c2 != '\\') { stringBuilder.Append(c); } else { stringBuilder.Append('/'); } } else if (i < path.Length - 2) { char c3 = path[i + 1]; char c4 = char.ToUpper(path[i + 2]); if ((c3 == '2' && c4 == 'F') || (c3 == '5' && c4 == 'C')) { stringBuilder.Append('/'); i += 2; } else { stringBuilder.Append(c); } } else { stringBuilder.Append(c); } } path = stringBuilder.ToString(); } else { path = path.Replace('\\', '/'); } ArrayList arrayList = new ArrayList(); int j = 0; while (j < path.Length) { int num = path.IndexOf('/', j); if (num == -1) { num = path.Length; } string text = path.Substring(j, num - j); j = num + 1; if (text.Length != 0 && !(text == ".")) { if (text == "..") { int count = arrayList.Count; if (count != 0) { arrayList.RemoveAt(count - 1); } } else { arrayList.Add(text); } } } if (arrayList.Count == 0) { return "/"; } stringBuilder.Length = 0; if (path[0] == '/') { stringBuilder.Append('/'); } bool flag = true; foreach (object obj in arrayList) { string text2 = (string)obj; if (flag) { flag = false; } else { stringBuilder.Append('/'); } stringBuilder.Append(text2); } if (path.EndsWith("/")) { stringBuilder.Append('/'); } return stringBuilder.ToString(); } // Token: 0x06001B9A RID: 7066 RVA: 0x00066FBC File Offset: 0x000651BC private static char HexUnescapeMultiByte(string pattern, ref int index, out char surrogate) { surrogate = '\0'; if (pattern == null) { throw new ArgumentException("pattern"); } if (index < 0 || index >= pattern.Length) { throw new ArgumentOutOfRangeException("index"); } if (!global::System.Uri.IsHexEncoding(pattern, index)) { return pattern[index++]; } int num = index++; int num2 = global::System.Uri.FromHex(pattern[index++]); int num3 = global::System.Uri.FromHex(pattern[index++]); int num4 = num2; int num5 = 0; while ((num4 & 8) == 8) { num5++; num4 <<= 1; } if (num5 <= 1) { return (char)((num2 << 4) | num3); } byte[] array = new byte[num5]; bool flag = false; array[0] = (byte)((num2 << 4) | num3); for (int i = 1; i < num5; i++) { if (!global::System.Uri.IsHexEncoding(pattern, index++)) { flag = true; break; } int num6 = global::System.Uri.FromHex(pattern[index++]); if ((num6 & 12) != 8) { flag = true; break; } int num7 = global::System.Uri.FromHex(pattern[index++]); array[i] = (byte)((num6 << 4) | num7); } if (flag) { index = num + 3; return (char)array[0]; } byte b = byte.MaxValue; b = (byte)(b >> num5 + 1); int num8 = (int)(array[0] & b); for (int j = 1; j < num5; j++) { num8 <<= 6; num8 |= (int)(array[j] & 63); } if (num8 <= 65535) { return (char)num8; } num8 -= 65536; surrogate = (char)((num8 & 1023) | 56320); return (char)((num8 >> 10) | 55296); } // Token: 0x06001B9B RID: 7067 RVA: 0x000671B0 File Offset: 0x000653B0 internal static string GetSchemeDelimiter(string scheme) { for (int i = 0; i < global::System.Uri.schemes.Length; i++) { if (global::System.Uri.schemes[i].scheme == scheme) { return global::System.Uri.schemes[i].delimiter; } } return global::System.Uri.SchemeDelimiter; } // Token: 0x06001B9C RID: 7068 RVA: 0x00067208 File Offset: 0x00065408 internal static int GetDefaultPort(string scheme) { global::System.UriParser uriParser = global::System.UriParser.GetParser(scheme); if (uriParser == null) { return -1; } return uriParser.DefaultPort; } // Token: 0x06001B9D RID: 7069 RVA: 0x0006722C File Offset: 0x0006542C private string GetOpaqueWiseSchemeDelimiter() { if (this.isOpaquePart) { return ":"; } return global::System.Uri.GetSchemeDelimiter(this.scheme); } /// Gets whether a character is invalid in a file system name. /// A value that is true if the specified character is invalid; otherwise false. /// The to test. // Token: 0x06001B9E RID: 7070 RVA: 0x0006724C File Offset: 0x0006544C [Obsolete] protected virtual bool IsBadFileSystemCharacter(char ch) { if (ch < ' ' || (ch < '@' && ch > '9')) { return true; } switch (ch) { case '*': case ',': case '/': break; default: switch (ch) { case '\\': case '^': break; default: if (ch != '\0' && ch != '"' && ch != '&' && ch != '|') { return false; } break; } break; } return true; } /// Gets whether the specified character should be escaped. /// A value that is true if the specified character should be escaped; otherwise, false. /// The to test. // Token: 0x06001B9F RID: 7071 RVA: 0x000672D4 File Offset: 0x000654D4 [Obsolete] protected static bool IsExcludedCharacter(char ch) { return ch <= ' ' || ch >= '\u007f' || (ch == '"' || ch == '#' || ch == '%' || ch == '<' || ch == '>' || ch == '[' || ch == '\\' || ch == ']' || ch == '^' || ch == '`' || ch == '{' || ch == '|' || ch == '}'); } // Token: 0x06001BA0 RID: 7072 RVA: 0x00067360 File Offset: 0x00065560 internal static bool MaybeUri(string s) { int num = s.IndexOf(':'); return num != -1 && num < 10 && global::System.Uri.IsPredefinedScheme(s.Substring(0, num)); } // Token: 0x06001BA1 RID: 7073 RVA: 0x00067398 File Offset: 0x00065598 private static bool IsPredefinedScheme(string scheme) { if (scheme != null) { if (global::System.Uri.<>f__switch$map16 == null) { global::System.Uri.<>f__switch$map16 = new Dictionary(10) { { "http", 0 }, { "https", 0 }, { "file", 0 }, { "ftp", 0 }, { "nntp", 0 }, { "gopher", 0 }, { "mailto", 0 }, { "news", 0 }, { "net.pipe", 0 }, { "net.tcp", 0 } }; } int num; if (global::System.Uri.<>f__switch$map16.TryGetValue(scheme, out num)) { if (num == 0) { return true; } } } return false; } /// Gets whether the specified character is a reserved character. /// A value that is true if the specified character is a reserved character otherwise, false. /// The to test. // Token: 0x06001BA2 RID: 7074 RVA: 0x00067460 File Offset: 0x00065660 [Obsolete] protected virtual bool IsReservedCharacter(char ch) { return ch == '$' || ch == '&' || ch == '+' || ch == ',' || ch == '/' || ch == ':' || ch == ';' || ch == '=' || ch == '@'; } // Token: 0x17000868 RID: 2152 // (get) Token: 0x06001BA3 RID: 7075 RVA: 0x000674B8 File Offset: 0x000656B8 // (set) Token: 0x06001BA4 RID: 7076 RVA: 0x000674F8 File Offset: 0x000656F8 private global::System.UriParser Parser { get { if (this.parser == null) { this.parser = global::System.UriParser.GetParser(this.Scheme); if (this.parser == null) { this.parser = new global::System.DefaultUriParser("*"); } } return this.parser; } set { this.parser = value; } } /// Gets the specified components of the current instance using the specified escaping for special characters. /// A that contains the components. /// A bitwise combination of the values that specifies which parts of the current instance to return to the caller. /// One of the values that controls how special characters are escaped. /// /// is not a combination of valid values. /// The current is not an absolute URI. Relative URIs cannot be used with this method. /// 1 // Token: 0x06001BA5 RID: 7077 RVA: 0x00067504 File Offset: 0x00065704 public string GetComponents(global::System.UriComponents components, global::System.UriFormat format) { return this.Parser.GetComponents(this, components, format); } /// Determines whether the current instance is a base of the specified instance. /// true if the current instance is a base of ; otherwise, false. /// The specified instance to test. /// 2 /// /// /// // Token: 0x06001BA6 RID: 7078 RVA: 0x00067514 File Offset: 0x00065714 public bool IsBaseOf(global::System.Uri uri) { return this.Parser.IsBaseOf(this, uri); } /// Indicates whether the string used to construct this was well-formed and is not required to be further escaped. /// A value that is true if the string was well-formed; else false. // Token: 0x06001BA7 RID: 7079 RVA: 0x00067524 File Offset: 0x00065724 public bool IsWellFormedOriginalString() { return global::System.Uri.EscapeString(this.OriginalString) == this.OriginalString; } /// Compares the specified parts of two URIs using the specified comparison rules. /// An value that indicates the lexical relationship between the compared components.ValueMeaningLess than zero is less than .Zero equals .Greater than zero is greater than . /// The first . /// The second . /// A bitwise combination of the values that specifies the parts of and to compare. /// One of the values that specifies the character escaping used when the URI components are compared. /// One of the values. /// /// is not a valid value. /// 1 // Token: 0x06001BA8 RID: 7080 RVA: 0x0006753C File Offset: 0x0006573C public static int Compare(global::System.Uri uri1, global::System.Uri uri2, global::System.UriComponents partsToCompare, global::System.UriFormat compareFormat, StringComparison comparisonType) { if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) { string text = global::Locale.GetText("Invalid StringComparison value '{0}'", new object[] { comparisonType }); throw new ArgumentException("comparisonType", text); } if (uri1 == null && uri2 == null) { return 0; } string components = uri1.GetComponents(partsToCompare, compareFormat); string components2 = uri2.GetComponents(partsToCompare, compareFormat); return string.Compare(components, components2, comparisonType); } // Token: 0x06001BA9 RID: 7081 RVA: 0x000675B8 File Offset: 0x000657B8 private static bool NeedToEscapeDataChar(char b) { return (b < 'A' || b > 'Z') && (b < 'a' || b > 'z') && (b < '0' || b > '9') && b != '_' && b != '~' && b != '!' && b != '\'' && b != '(' && b != ')' && b != '*' && b != '-' && b != '.'; } /// Converts a string to its escaped representation. /// A that contains the escaped representation of . /// The string to escape. /// /// is null. /// The length of exceeds 32766 characters. // Token: 0x06001BAA RID: 7082 RVA: 0x00067640 File Offset: 0x00065840 public static string EscapeDataString(string stringToEscape) { if (stringToEscape == null) { throw new ArgumentNullException("stringToEscape"); } if (stringToEscape.Length > 32766) { string text = global::Locale.GetText("Uri is longer than the maximum {0} characters."); throw new global::System.UriFormatException(text); } bool flag = false; foreach (char c in stringToEscape) { if (global::System.Uri.NeedToEscapeDataChar(c)) { flag = true; break; } } if (!flag) { return stringToEscape; } StringBuilder stringBuilder = new StringBuilder(); byte[] bytes = Encoding.UTF8.GetBytes(stringToEscape); foreach (byte b in bytes) { if (global::System.Uri.NeedToEscapeDataChar((char)b)) { stringBuilder.Append(global::System.Uri.HexEscape((char)b)); } else { stringBuilder.Append((char)b); } } return stringBuilder.ToString(); } // Token: 0x06001BAB RID: 7083 RVA: 0x00067730 File Offset: 0x00065930 private static bool NeedToEscapeUriChar(char b) { return (b < 'A' || b > 'Z') && (b < 'a' || b > 'z') && (b < '&' || b > ';') && b != '!' && b != '#' && b != '$' && b != '=' && b != '?' && b != '@' && b != '_' && b != '~'; } /// Converts a URI string to its escaped representation. /// A that contains the escaped representation of . /// The string to escape. /// /// is null. /// The length of exceeds 32766 characters. // Token: 0x06001BAC RID: 7084 RVA: 0x000677B0 File Offset: 0x000659B0 public static string EscapeUriString(string stringToEscape) { if (stringToEscape == null) { throw new ArgumentNullException("stringToEscape"); } if (stringToEscape.Length > 32766) { string text = global::Locale.GetText("Uri is longer than the maximum {0} characters."); throw new global::System.UriFormatException(text); } bool flag = false; foreach (char c in stringToEscape) { if (global::System.Uri.NeedToEscapeUriChar(c)) { flag = true; break; } } if (!flag) { return stringToEscape; } StringBuilder stringBuilder = new StringBuilder(); byte[] bytes = Encoding.UTF8.GetBytes(stringToEscape); foreach (byte b in bytes) { if (global::System.Uri.NeedToEscapeUriChar((char)b)) { stringBuilder.Append(global::System.Uri.HexEscape((char)b)); } else { stringBuilder.Append((char)b); } } return stringBuilder.ToString(); } /// 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. /// A value that is true if the string was well-formed; else false. /// The string used to attempt to construct a . /// The type of the in . // Token: 0x06001BAD RID: 7085 RVA: 0x000678A0 File Offset: 0x00065AA0 public static bool IsWellFormedUriString(string uriString, global::System.UriKind uriKind) { global::System.Uri uri; return uriString != null && global::System.Uri.TryCreate(uriString, uriKind, out uri) && uri.IsWellFormedOriginalString(); } /// Creates a new using the specified instance and a . /// A value that is true if the was successfully created; otherwise, false. /// The representing the . /// The type of the Uri. /// When this method returns, contains the constructed . // Token: 0x06001BAE RID: 7086 RVA: 0x000678CC File Offset: 0x00065ACC public static bool TryCreate(string uriString, global::System.UriKind uriKind, out global::System.Uri result) { bool flag; global::System.Uri uri = new global::System.Uri(uriString, uriKind, out flag); if (flag) { result = uri; return true; } result = null; return false; } /// Creates a new using the specified base and relative instances. /// A value that is true if the was successfully created; otherwise, false. /// The base . /// The relative , represented as a , to add to the base . /// When this method returns, contains a constructed from and . This parameter is passed uninitialized. // Token: 0x06001BAF RID: 7087 RVA: 0x000678F4 File Offset: 0x00065AF4 public static bool TryCreate(global::System.Uri baseUri, string relativeUri, out global::System.Uri result) { bool flag; try { result = new global::System.Uri(baseUri, relativeUri); flag = true; } catch (global::System.UriFormatException) { result = null; flag = false; } return flag; } /// Creates a new using the specified base and relative instances. /// A value that is true if the was successfully created; otherwise, false. /// The base . /// The relative to add to the base . /// When this method returns, contains a constructed from and . This parameter is passed uninitialized. /// 1 // Token: 0x06001BB0 RID: 7088 RVA: 0x00067944 File Offset: 0x00065B44 public static bool TryCreate(global::System.Uri baseUri, global::System.Uri relativeUri, out global::System.Uri result) { bool flag; try { result = new global::System.Uri(baseUri, relativeUri.OriginalString); flag = true; } catch (global::System.UriFormatException) { result = null; flag = false; } return flag; } /// Converts a string to its unescaped representation. /// A that contains the unescaped representation of . /// The string to unescape. /// /// is null. // Token: 0x06001BB1 RID: 7089 RVA: 0x00067998 File Offset: 0x00065B98 public static string UnescapeDataString(string stringToUnescape) { if (stringToUnescape == null) { throw new ArgumentNullException("stringToUnescape"); } if (stringToUnescape.IndexOf('%') == -1 && stringToUnescape.IndexOf('+') == -1) { return stringToUnescape; } StringBuilder stringBuilder = new StringBuilder(); long num = (long)stringToUnescape.Length; MemoryStream memoryStream = new MemoryStream(); int num2 = 0; while ((long)num2 < num) { if (stringToUnescape[num2] == '%' && (long)(num2 + 2) < num && stringToUnescape[num2 + 1] != '%') { int num3; if (stringToUnescape[num2 + 1] == 'u' && (long)(num2 + 5) < num) { if (memoryStream.Length > 0L) { stringBuilder.Append(global::System.Uri.GetChars(memoryStream, Encoding.UTF8)); memoryStream.SetLength(0L); } num3 = global::System.Uri.GetChar(stringToUnescape, num2 + 2, 4); if (num3 != -1) { stringBuilder.Append((char)num3); num2 += 5; } else { stringBuilder.Append('%'); } } else if ((num3 = global::System.Uri.GetChar(stringToUnescape, num2 + 1, 2)) != -1) { memoryStream.WriteByte((byte)num3); num2 += 2; } else { stringBuilder.Append('%'); } } else { if (memoryStream.Length > 0L) { stringBuilder.Append(global::System.Uri.GetChars(memoryStream, Encoding.UTF8)); memoryStream.SetLength(0L); } stringBuilder.Append(stringToUnescape[num2]); } num2++; } if (memoryStream.Length > 0L) { stringBuilder.Append(global::System.Uri.GetChars(memoryStream, Encoding.UTF8)); } return stringBuilder.ToString(); } // Token: 0x06001BB2 RID: 7090 RVA: 0x00067B34 File Offset: 0x00065D34 private static int GetInt(byte b) { char c = (char)b; if (c >= '0' && c <= '9') { return (int)(c - '0'); } if (c >= 'a' && c <= 'f') { return (int)(c - 'a' + '\n'); } if (c >= 'A' && c <= 'F') { return (int)(c - 'A' + '\n'); } return -1; } // Token: 0x06001BB3 RID: 7091 RVA: 0x00067B8C File Offset: 0x00065D8C private static int GetChar(string str, int offset, int length) { int num = 0; int num2 = length + offset; for (int i = offset; i < num2; i++) { char c = str[i]; if (c > '\u007f') { return -1; } int @int = global::System.Uri.GetInt((byte)c); if (@int == -1) { return -1; } num = (num << 4) + @int; } return num; } // Token: 0x06001BB4 RID: 7092 RVA: 0x00067BE0 File Offset: 0x00065DE0 private static char[] GetChars(MemoryStream b, Encoding e) { return e.GetChars(b.GetBuffer(), 0, (int)b.Length); } // Token: 0x06001BB5 RID: 7093 RVA: 0x00067C04 File Offset: 0x00065E04 private void EnsureAbsoluteUri() { if (!this.IsAbsoluteUri) { throw new InvalidOperationException("This operation is not supported for a relative URI."); } } /// Determines whether two instances have the same value. /// A value that is true if the instances are equivalent; otherwise, false. /// A instance to compare with . /// A instance to compare with . /// 3 /// /// /// // Token: 0x06001BB6 RID: 7094 RVA: 0x00067C1C File Offset: 0x00065E1C public static bool operator ==(global::System.Uri u1, global::System.Uri u2) { return object.Equals(u1, u2); } /// Determines whether two instances do not have the same value. /// A value that is true if the two instances are not equal; otherwise, false. If either parameter is null, this method returns true. /// A instance to compare with . /// A instance to compare with . /// 3 /// /// /// // Token: 0x06001BB7 RID: 7095 RVA: 0x00067C28 File Offset: 0x00065E28 public static bool operator !=(global::System.Uri u1, global::System.Uri u2) { return !(u1 == u2); } // Token: 0x040015E7 RID: 5607 private const int MaxUriLength = 32766; // Token: 0x040015E8 RID: 5608 private bool isUnixFilePath; // Token: 0x040015E9 RID: 5609 private string source; // Token: 0x040015EA RID: 5610 private string scheme; // Token: 0x040015EB RID: 5611 private string host; // Token: 0x040015EC RID: 5612 private int port; // Token: 0x040015ED RID: 5613 private string path; // Token: 0x040015EE RID: 5614 private string query; // Token: 0x040015EF RID: 5615 private string fragment; // Token: 0x040015F0 RID: 5616 private string userinfo; // Token: 0x040015F1 RID: 5617 private bool isUnc; // Token: 0x040015F2 RID: 5618 private bool isOpaquePart; // Token: 0x040015F3 RID: 5619 private bool isAbsoluteUri; // Token: 0x040015F4 RID: 5620 private string[] segments; // Token: 0x040015F5 RID: 5621 private bool userEscaped; // Token: 0x040015F6 RID: 5622 private string cachedAbsoluteUri; // Token: 0x040015F7 RID: 5623 private string cachedToString; // Token: 0x040015F8 RID: 5624 private string cachedLocalPath; // Token: 0x040015F9 RID: 5625 private int cachedHashCode; // Token: 0x040015FA RID: 5626 private static readonly string hexUpperChars = "0123456789ABCDEF"; /// Specifies the characters that separate the communication protocol scheme from the address portion of the URI. This field is read-only. /// 1 // Token: 0x040015FB RID: 5627 public static readonly string SchemeDelimiter = "://"; /// Specifies that the URI is a pointer to a file. This field is read-only. /// 1 // Token: 0x040015FC RID: 5628 public static readonly string UriSchemeFile = "file"; /// Specifies that the URI is accessed through the File Transfer Protocol (FTP). This field is read-only. /// 1 // Token: 0x040015FD RID: 5629 public static readonly string UriSchemeFtp = "ftp"; /// Specifies that the URI is accessed through the Gopher protocol. This field is read-only. /// 1 // Token: 0x040015FE RID: 5630 public static readonly string UriSchemeGopher = "gopher"; /// Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only. /// 1 // Token: 0x040015FF RID: 5631 public static readonly string UriSchemeHttp = "http"; /// Specifies that the URI is accessed through the Secure Hypertext Transfer Protocol (HTTPS). This field is read-only. /// 1 // Token: 0x04001600 RID: 5632 public static readonly string UriSchemeHttps = "https"; /// Specifies that the URI is an e-mail address and is accessed through the Simple Mail Transport Protocol (SMTP). This field is read-only. /// 1 // Token: 0x04001601 RID: 5633 public static readonly string UriSchemeMailto = "mailto"; /// Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only. /// 1 // Token: 0x04001602 RID: 5634 public static readonly string UriSchemeNews = "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. /// 1 // Token: 0x04001603 RID: 5635 public static readonly string UriSchemeNntp = "nntp"; /// Specifies that the URI is accessed through the NetPipe scheme used by Windows Communication Foundation (WCF). This field is read-only. // Token: 0x04001604 RID: 5636 public static readonly string UriSchemeNetPipe = "net.pipe"; /// Specifies that the URI is accessed through the NetTcp scheme used by Windows Communication Foundation (WCF). This field is read-only. // Token: 0x04001605 RID: 5637 public static readonly string UriSchemeNetTcp = "net.tcp"; // Token: 0x04001606 RID: 5638 private static global::System.Uri.UriScheme[] schemes = new global::System.Uri.UriScheme[] { new global::System.Uri.UriScheme(global::System.Uri.UriSchemeHttp, global::System.Uri.SchemeDelimiter, 80), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeHttps, global::System.Uri.SchemeDelimiter, 443), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeFtp, global::System.Uri.SchemeDelimiter, 21), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeFile, global::System.Uri.SchemeDelimiter, -1), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeMailto, ":", 25), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeNews, ":", 119), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeNntp, global::System.Uri.SchemeDelimiter, 119), new global::System.Uri.UriScheme(global::System.Uri.UriSchemeGopher, global::System.Uri.SchemeDelimiter, 70) }; // Token: 0x04001607 RID: 5639 [NonSerialized] private global::System.UriParser parser; // Token: 0x020002FC RID: 764 private struct UriScheme { // Token: 0x06001BB8 RID: 7096 RVA: 0x00067C34 File Offset: 0x00065E34 public UriScheme(string s, string d, int p) { this.scheme = s; this.delimiter = d; this.defaultPort = p; } // Token: 0x0400160D RID: 5645 public string scheme; // Token: 0x0400160E RID: 5646 public string delimiter; // Token: 0x0400160F RID: 5647 public int defaultPort; } } }