Share via


SocketPermissionAttribute.Port 屬性

定義

取得或設定與這個 SocketPermissionAttribute 關聯的通訊埠編號。

public:
 property System::String ^ Port { System::String ^ get(); void set(System::String ^ value); };
public string Port { get; set; }
member this.Port : string with get, set
Public Property Port As String

屬性值

字串,包含與這個 SocketPermissionAttribute 的執行個體關聯的通訊埠編號。

例外狀況

當嘗試設定此值時,Port 屬性是 null。 若要指定一個以上的連接埠,請使用額外的屬性宣告陳述式。

備註

這個屬性是寫入一次,並指定套用此許可權的埠號碼。 有效值為字串編碼的整數或字串 「All」。

適用於