Constructs and initializes a new instance of the UriBuilder class with the specified scheme, host, port number, path, and query string or fragment identifier.
Type Reason ArgumentOutOfRangeException port is less than zero. ArgumentException extraValue 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.
This constructor creates a new instance of the UriBuilder class with its properties initialized as follows:
Property Initial value Fragment If extraValue begins with a "#", extraValue; otherwise string.Empty . Host host Password string.Empty Path path Port port Query If extraValue begins with a "?", extraValue; otherwise string.Empty . Scheme scheme UserName string.Empty Before setting the UriBuilder.Path property, this constructor converts any backward slashes in path to forward slashes, and calls Uri.EscapeString(string)(path).
Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0