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;
An instance of the SocketPermission class corresponding to the security declaration.
|ArgumentException||One or more of the current instance's Access, Host, Transport, or Port properties is a null reference (Nothing in Visual Basic).|
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.
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