Port Property
Collapse the table of content
Expand the table of content

UriBuilder.Port Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the port number of the URI.

Namespace:  System
Assembly:  System (in System.dll)

public int Port { get; set; }

Property Value

Type: System.Int32
The port number of the URI.

ExceptionCondition
ArgumentOutOfRangeException

The port number cannot be set to less than 0 or greater than 65,535.

The port number defines the protocol port for contacting the server referenced in the URI. If a port is not specified as part of the URI, the Port property returns the value -1 to indicate that the server uses the default value for the protocol.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft