This documentation is archived and is not being maintained.

SocketPermissionAttribute.Port Property

Gets or sets the port number associated with this SocketPermissionAttribute.

[Visual Basic]
Public Property Port As String
public string Port {get; set;}
public: __property String* get_Port();
public: __property void set_Port(String*);
public function get Port() : String;
public function set Port(String);

Property Value

A string containing the port number associated with this instance of SocketPermissionAttribute.


Exception Type Condition
ArgumentException The Port property is a null reference (Nothing in Visual Basic) when attempt to set the value. To specify more than one port, use an additional attribute declaration statement.


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".


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

SocketPermissionAttribute Class | SocketPermissionAttribute Members | System.Net Namespace