語言

UriBuilder.Port 屬性

定義

取得或設定 URI 的埠號。

public:
 property int Port { int get(); void set(int value); };
public int Port { get; set; }
member this.Port : int with get, set
Public Property Port As Integer

屬性值

URI 的港口號碼。

例外狀況

埠號的值不得小於 -1,也不能大於 65,535。

備註

埠號定義了連接 URI 中所提及主機的協定埠。 若 URI Port 未指定埠口,該屬性會回傳 -1 值,表示協定方案的預設埠值將用於連接主機。 若 Port 屬性設定為 -1,表示該協定方案的預設埠值將用於連接主機。

適用於

另請參閱