Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Port Property
Collapse the table of content
Expand the table of content

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

© 2015 Microsoft