8 [global::__DynamicallyInvokable]
11 private bool m_changed =
true;
13 private string m_fragment =
string.Empty;
15 private string m_host =
"localhost";
17 private string m_password =
string.Empty;
19 private string m_path =
"/";
21 private int m_port = -1;
23 private string m_query =
string.Empty;
25 private string m_scheme =
"http";
31 private string m_username =
string.Empty;
52 int num = value.IndexOf(
'#');
61 Query = value.Substring(1, num - 1);
73 [global::__DynamicallyInvokable]
76 [global::__DynamicallyInvokable]
81 [global::__DynamicallyInvokable]
99 [global::__DynamicallyInvokable]
102 [global::__DynamicallyInvokable]
107 [global::__DynamicallyInvokable]
112 value =
string.Empty;
115 if (m_host.IndexOf(
':') >= 0 && m_host[0] !=
'[')
117 m_host =
"[" + m_host +
"]";
125 [global::__DynamicallyInvokable]
128 [global::__DynamicallyInvokable]
133 [global::__DynamicallyInvokable]
138 value =
string.Empty;
147 [global::__DynamicallyInvokable]
150 [global::__DynamicallyInvokable]
155 [global::__DynamicallyInvokable]
158 if (value ==
null || value.Length == 0)
162 m_path =
Uri.InternalEscapeString(ConvertSlashes(value));
170 [global::__DynamicallyInvokable]
173 [global::__DynamicallyInvokable]
178 [global::__DynamicallyInvokable]
181 if (value < -1 || value > 65535)
192 [global::__DynamicallyInvokable]
195 [global::__DynamicallyInvokable]
200 [global::__DynamicallyInvokable]
205 value =
string.Empty;
207 if (value.Length > 0)
219 [global::__DynamicallyInvokable]
222 [global::__DynamicallyInvokable]
227 [global::__DynamicallyInvokable]
232 value =
string.Empty;
234 int num = value.IndexOf(
':');
237 value = value.Substring(0, num);
239 if (value.Length != 0)
256 [global::__DynamicallyInvokable]
259 [global::__DynamicallyInvokable]
265 SetFieldsFromUri(m_uri);
274 [global::__DynamicallyInvokable]
277 [global::__DynamicallyInvokable]
282 [global::__DynamicallyInvokable]
287 value =
string.Empty;
295 [global::__DynamicallyInvokable]
308 [global::__DynamicallyInvokable]
325 [global::__DynamicallyInvokable]
328 if ((
object)uri ==
null)
335 private void Init(
Uri uri)
345 if (!
string.IsNullOrEmpty(userInfo))
347 int num = userInfo.IndexOf(
':');
350 m_password = userInfo.Substring(num + 1);
351 m_username = userInfo.Substring(0, num);
355 m_username = userInfo;
358 SetFieldsFromUri(uri);
364 [global::__DynamicallyInvokable]
377 [global::__DynamicallyInvokable]
378 public UriBuilder(
string scheme,
string host,
int portNumber)
391 [global::__DynamicallyInvokable]
392 public UriBuilder(
string scheme,
string host,
int port,
string pathValue)
393 : this(scheme, host, port)
408 [global::__DynamicallyInvokable]
409 public UriBuilder(
string scheme,
string host,
int port,
string path,
string extraValue)
410 : this(scheme, host, port, path)
426 private string ConvertSlashes(
string path)
429 for (
int i = 0; i < path.Length; i++)
445 [global::__DynamicallyInvokable]
446 public override bool Equals(
object rparam)
457 [global::__DynamicallyInvokable]
463 private void SetFieldsFromUri(
Uri uri)
473 if (userInfo.Length > 0)
475 int num = userInfo.IndexOf(
':');
478 m_password = userInfo.Substring(num + 1);
479 m_username = userInfo.Substring(0, num);
483 m_username = userInfo;
492 [global::__DynamicallyInvokable]
495 if (m_username.Length == 0 && m_password.Length > 0)
499 if (m_scheme.Length != 0)
504 m_schemeDelimiter = ((syntax.InFact(UriSyntaxFlags.MustHaveAuthority) || (m_host.Length != 0 && syntax.NotAny(UriSyntaxFlags.MailToLikeUri) && syntax.InFact(UriSyntaxFlags.OptionalAuthority))) ?
Uri.
SchemeDelimiter :
":");
511 string text = (m_scheme.Length != 0) ? (m_scheme + m_schemeDelimiter) :
string.Empty;
512 return text + m_username + ((m_password.Length > 0) ? (
":" + m_password) :
string.Empty) + ((m_username.Length > 0) ?
"@" :
string.Empty) + m_host + ((m_port != -1 && m_host.Length > 0) ? (
":" + m_port) :
string.Empty) + ((m_host.Length > 0 && m_path.Length != 0 && m_path[0] !=
'/') ?
"/" :
string.Empty) + m_path + m_query + m_fragment;
UriKind
Defines the kinds of T:System.Uris for the M:System.Uri.IsWellFormedUriString(System....
UriBuilder(string scheme, string host, int port, string path, string extraValue)
Initializes a new instance of the T:System.UriBuilder class with the specified scheme,...
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
int Port
Gets the port number of this URI.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static readonly string UriSchemeHttp
Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP)....
string Path
Gets or sets the path to the resource referenced by the URI.
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
The exception that is thrown when the execution stack overflows because it contains too many nested m...
override int GetHashCode()
Returns the hash code for the URI.
string Scheme
Gets or sets the scheme name of the URI.
string Scheme
Gets the scheme name for this URI.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
UriBuilder(string scheme, string host, int port, string pathValue)
Initializes a new instance of the T:System.UriBuilder class with the specified scheme,...
UriBuilder(string scheme, string host, int portNumber)
Initializes a new instance of the T:System.UriBuilder class with the specified scheme,...
string Host
Gets or sets the Domain Name System (DNS) host name or IP address of a server.
override int GetHashCode()
Gets the hash code for the URI.
bool IsAbsoluteUri
Gets whether the T:System.Uri instance is absolute.
string AbsolutePath
Gets the absolute path of the URI.
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
UriBuilder(string uri)
Initializes a new instance of the T:System.UriBuilder class with the specified URI.
Uri Uri
Gets the T:System.Uri instance constructed by the specified T:System.UriBuilder instance.
override bool Equals(object rparam)
Compares an existing T:System.Uri instance with the contents of the T:System.UriBuilder for equality.
string Query
Gets any query information included in the specified URI.
unsafe override bool Equals(object comparand)
Compares two T:System.Uri instances for equality.
The exception that is thrown when there is not enough memory to continue the execution of a program.
int Port
Gets or sets the port number of the URI.
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the T:Sys...
The exception that is thrown when one of the arguments provided to a method is not valid.
string Fragment
Gets or sets the fragment portion of the URI.
override string ToString()
Returns the display string for the specified T:System.UriBuilder instance.
string? Query
Gets or sets any query information included in the URI.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
string UserInfo
Gets the user name, password, or other user-specific information associated with the specified URI.
string Fragment
Gets the escaped URI fragment.
UriBuilder(string schemeName, string hostName)
Initializes a new instance of the T:System.UriBuilder class with the specified scheme and host.
static readonly string SchemeDelimiter
Specifies the characters that separate the communication protocol scheme from the address portion of ...
static bool CheckSchemeName(string schemeName)
Determines whether the specified scheme name is valid.
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when a call is made to the M:System.Threading.Thread....
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts...
UriBuilder(Uri uri)
Initializes a new instance of the T:System.UriBuilder class with the specified T:System....
Parses a new URI scheme. This is an abstract class.
string Host
Gets the host component of this instance.
string Password
Gets or sets the password associated with the user that accesses the URI.
string UserName
The user name associated with the user that accesses the URI.
UriBuilder()
Initializes a new instance of the T:System.UriBuilder class.