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”。

适用于