Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets the port number of this URI.
Namespace: System
Assembly: System.Http (in System.Http.dll)
Syntax
'Declaration
Public ReadOnly Property Port As Integer
public int Port { get; }
public:
property int Port {
int get ();
}
member Port : int with get
function get Port () : int
Property Value
Type: System. . :: . .Int32
An Int32 value that contains the port number for this URI.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | This instance represents a relative URI, and this property is valid only for absolute URIs. |
Remarks
The port number defines the protocol port used for contacting the server referenced in the URI. If a port is not specified as part of the URI, the Port property returns the default value for the protocol. If there is no default port number, this property returns -1.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.