mscorlib(4.0.0.0) API with additions
System.UriBuilder Class Reference

Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the T:System.Uri class. More...

Public Member Functions

 UriBuilder ()
 Initializes a new instance of the T:System.UriBuilder class. More...
 
 UriBuilder (string uri)
 Initializes a new instance of the T:System.UriBuilder class with the specified URI. More...
 
 UriBuilder (Uri uri)
 Initializes a new instance of the T:System.UriBuilder class with the specified T:System.Uri instance. More...
 
 UriBuilder (string schemeName, string hostName)
 Initializes a new instance of the T:System.UriBuilder class with the specified scheme and host. More...
 
 UriBuilder (string scheme, string host, int portNumber)
 Initializes a new instance of the T:System.UriBuilder class with the specified scheme, host, and port. More...
 
 UriBuilder (string scheme, string host, int port, string pathValue)
 Initializes a new instance of the T:System.UriBuilder class with the specified scheme, host, port number, and path. More...
 
 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, host, port number, path and query string or fragment identifier. More...
 
override bool Equals (object rparam)
 Compares an existing T:System.Uri instance with the contents of the T:System.UriBuilder for equality. More...
 
override int GetHashCode ()
 Returns the hash code for the URI. More...
 
override string ToString ()
 Returns the display string for the specified T:System.UriBuilder instance. More...
 

Properties

string Fragment [get, set]
 Gets or sets the fragment portion of the URI. More...
 
string Host [get, set]
 Gets or sets the Domain Name System (DNS) host name or IP address of a server. More...
 
string Password [get, set]
 Gets or sets the password associated with the user that accesses the URI. More...
 
string Path [get, set]
 Gets or sets the path to the resource referenced by the URI. More...
 
int Port [get, set]
 Gets or sets the port number of the URI. More...
 
string? Query [get, set]
 Gets or sets any query information included in the URI. More...
 
string Scheme [get, set]
 Gets or sets the scheme name of the URI. More...
 
Uri Uri [get]
 Gets the T:System.Uri instance constructed by the specified T:System.UriBuilder instance. More...
 
string UserName [get, set]
 The user name associated with the user that accesses the URI. More...
 

Detailed Description

Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the T:System.Uri class.

Definition at line 9 of file UriBuilder.cs.

Constructor & Destructor Documentation

◆ UriBuilder() [1/7]

System.UriBuilder.UriBuilder ( )

Initializes a new instance of the T:System.UriBuilder class.

Definition at line 296 of file UriBuilder.cs.

◆ UriBuilder() [2/7]

System.UriBuilder.UriBuilder ( string  uri)

Initializes a new instance of the T:System.UriBuilder class with the specified URI.

Parameters
uriA URI string.
Exceptions
T:System.ArgumentNullExceptionuri is null.
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead. uri is a zero length string or contains only spaces.-or- The parsing routine detected a scheme in an invalid form.-or- The parser detected more than two consecutive slashes in a URI that does not use the "file" scheme.-or- uri is not a valid URI.

Definition at line 309 of file UriBuilder.cs.

◆ UriBuilder() [3/7]

System.UriBuilder.UriBuilder ( Uri  uri)

Initializes a new instance of the T:System.UriBuilder class with the specified T:System.Uri instance.

Parameters
uriAn instance of the T:System.Uri class.
Exceptions
T:System.ArgumentNullExceptionuri is null.

Definition at line 326 of file UriBuilder.cs.

◆ UriBuilder() [4/7]

System.UriBuilder.UriBuilder ( string  schemeName,
string  hostName 
)

Initializes a new instance of the T:System.UriBuilder class with the specified scheme and host.

Parameters
schemeNameAn Internet access protocol.
hostNameA DNS-style domain name or IP address.

Definition at line 365 of file UriBuilder.cs.

◆ UriBuilder() [5/7]

System.UriBuilder.UriBuilder ( string  scheme,
string  host,
int  portNumber 
)

Initializes a new instance of the T:System.UriBuilder class with the specified scheme, host, and port.

Parameters
schemeAn Internet access protocol.
hostA DNS-style domain name or IP address.
portNumberAn IP port number for the service.
Exceptions
T:System.ArgumentOutOfRangeExceptionportNumber is less than -1 or greater than 65,535.

Definition at line 378 of file UriBuilder.cs.

◆ UriBuilder() [6/7]

System.UriBuilder.UriBuilder ( string  scheme,
string  host,
int  port,
string  pathValue 
)

Initializes a new instance of the T:System.UriBuilder class with the specified scheme, host, port number, and path.

Parameters
schemeAn Internet access protocol.
hostA DNS-style domain name or IP address.
portAn IP port number for the service.
pathValueThe path to the Internet resource.
Exceptions
T:System.ArgumentOutOfRangeExceptionport is less than -1 or greater than 65,535.

Definition at line 392 of file UriBuilder.cs.

◆ UriBuilder() [7/7]

System.UriBuilder.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, host, port number, path and query string or fragment identifier.

Parameters
schemeAn Internet access protocol.
hostA DNS-style domain name or IP address.
portAn IP port number for the service.
pathThe path to the Internet resource.
extraValueA query string or fragment identifier.
Exceptions
T:System.ArgumentExceptionextraValue is neither null nor F:System.String.Empty, nor does a valid fragment identifier begin with a number sign (#), nor a valid query string begin with a question mark (?).
T:System.ArgumentOutOfRangeExceptionport is less than -1 or greater than 65,535.

Definition at line 409 of file UriBuilder.cs.

Member Function Documentation

◆ Equals()

override bool System.UriBuilder.Equals ( object  rparam)

Compares an existing T:System.Uri instance with the contents of the T:System.UriBuilder for equality.

Parameters
rparamThe object to compare with the current instance.
Returns
true if rparam represents the same T:System.Uri as the T:System.Uri constructed by this T:System.UriBuilder instance; otherwise, false.

Definition at line 446 of file UriBuilder.cs.

◆ GetHashCode()

override int System.UriBuilder.GetHashCode ( )

Returns the hash code for the URI.

Returns
The hash code generated for the URI.

Definition at line 458 of file UriBuilder.cs.

◆ ToString()

override string System.UriBuilder.ToString ( )

Returns the display string for the specified T:System.UriBuilder instance.

Returns
The string that contains the unescaped display string of the T:System.UriBuilder.
Exceptions
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The T:System.UriBuilder instance has a bad password.

Definition at line 493 of file UriBuilder.cs.

Property Documentation

◆ Fragment

string System.UriBuilder.Fragment
getset

Gets or sets the fragment portion of the URI.

Returns
The fragment portion of the URI. The fragment identifier ("#") is added to the beginning of the fragment.

Definition at line 75 of file UriBuilder.cs.

◆ Host

string System.UriBuilder.Host
getset

Gets or sets the Domain Name System (DNS) host name or IP address of a server.

Returns
The DNS host name or IP address of the server.

Definition at line 101 of file UriBuilder.cs.

◆ Password

string System.UriBuilder.Password
getset

Gets or sets the password associated with the user that accesses the URI.

Returns
The password of the user that accesses the URI.

Definition at line 127 of file UriBuilder.cs.

◆ Path

string System.UriBuilder.Path
getset

Gets or sets the path to the resource referenced by the URI.

Returns
The path to the resource referenced by the URI.

Definition at line 149 of file UriBuilder.cs.

◆ Port

int System.UriBuilder.Port
getset

Gets or sets the port number of the URI.

Returns
The port number of the URI.
Exceptions
T:System.ArgumentOutOfRangeExceptionThe port cannot be set to a value less than -1 or greater than 65,535.

Definition at line 172 of file UriBuilder.cs.

◆ Query

string? System.UriBuilder.Query
getset

Gets or sets any query information included in the URI.

Returns
The query information included in the URI.

Definition at line 194 of file UriBuilder.cs.

◆ Scheme

string System.UriBuilder.Scheme
getset

Gets or sets the scheme name of the URI.

Returns
The scheme of the URI.
Exceptions
T:System.ArgumentExceptionThe scheme cannot be set to an invalid scheme name.

Definition at line 221 of file UriBuilder.cs.

◆ Uri

Uri System.UriBuilder.Uri
get

Gets the T:System.Uri instance constructed by the specified T:System.UriBuilder instance.

Returns
A T:System.Uri that contains the URI constructed by the T:System.UriBuilder.
Exceptions
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI constructed by the T:System.UriBuilder properties is invalid.

Definition at line 258 of file UriBuilder.cs.

◆ UserName

string System.UriBuilder.UserName
getset

The user name associated with the user that accesses the URI.

Returns
The user name of the user that accesses the URI.

Definition at line 276 of file UriBuilder.cs.


The documentation for this class was generated from the following file: