Mono Class Library: System.UriBuilder Overview | Members

System.UriBuilder.Port Property

Gets or sets the port number used to connect to the UriBuilder.Host referenced by the current instance.

public int Port { set; get; }

Value

A int containing a non-negative port number or -1.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value specified for a set operation was less than zero.

Remarks

If no port was specified, the Uri.Port property returns the default port as determined by the scheme of the current instance. A port value of -1 indicates that the current scheme does not use a port, as is the case when the scheme of the current instance is the Uri.UriSchemeFile scheme.

Note: For the list of default ports used with each scheme, see Uri.Port .

Requirements

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