System.Net.SocketPermissionAttribute.Port Property

Gets or sets the port number that is associated with this System.Net.SocketPermissionAttribute.

Syntax

public string Port { get; set; }

Value

A string containing a port number, or "All" or -1 to indicate all ports.

Exceptions

TypeReason
ArgumentException SocketPermissionAttribute.Port is being set and is not null.

Remarks

This property is write-once and specifies the port number to which this permission applies. The valid values are a string-encoded integer or the string "All".

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0