Export (0) Print
Expand All

SocketPermissionAttribute.CreatePermission Method

Creates and returns a new instance of the SocketPermission class.

[Visual Basic]
Overrides Public Function CreatePermission() As IPermission
[C#]
public override IPermission CreatePermission();
[C++]
public: IPermission* CreatePermission();
[JScript]
public override function CreatePermission() : IPermission;

Return Value

An instance of the SocketPermission class corresponding to the security declaration.

Exceptions

Exception Type Condition
ArgumentException One or more of the current instance's Access, Host, Transport, or Port properties is a null reference (Nothing in Visual Basic).

Remarks

The CreatePermission method is called by the security system, not by the application code. The security information described by SocketPermissionAttribute is stored in the metadata of the attribute target, which is the class to which the SocketPermissionAttribute is applied. The system then accesses the information at run_time and calls CreatePermission. The system uses the returned IPermission to enforce the specified security requirements.

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 | SocketPermission

Show:
© 2014 Microsoft