Mono Class Library: System.UriBuilder Overview | Members

System.UriBuilder Constructor

Constructs and initializes a new instance of the UriBuilder class with the specified scheme, host, port number, path, and query string or fragment identifier.

public UriBuilder (string scheme, string host, int port, string pathValue, string extraValue)

Parameters

scheme
A string containing the name of an Internet access protocol.
host
A string containing a DNS host name or IP address.
port
A int containing an IP port number.
pathValue
Documentation for this section has not yet been entered.
extraValue
A string containing a query or fragment component.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionport is less than zero.
ArgumentExceptionextraValue is not null or string.Empty, and does not have as its first character a number sign ('#') indicating a fragment, or a question mark ('?') indicating a query.

Remarks

This constructor creates a new instance of the UriBuilder class with its properties initialized as follows:

PropertyInitial value
FragmentIf extraValue begins with a "#", extraValue; otherwise string.Empty .
Hosthost
Passwordstring.Empty
Pathpath
Portport
QueryIf extraValue begins with a "?", extraValue; otherwise string.Empty .
Schemescheme
UserNamestring.Empty

Before setting the UriBuilder.Path property, this constructor converts any backward slashes in path to forward slashes, and calls Uri.EscapeString(string)(path).

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0