Export (0) Print
Expand All

SocketPermissionAttribute.Port Property

Gets or sets the port number associated with this SocketPermissionAttribute.

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

Property Value

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

Exceptions

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.

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

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

Show:
© 2014 Microsoft