SocketPermission.Copy Method ()


Creates a copy of a SocketPermission instance.

Namespace:   System.Net
Assembly:  System (in System.dll)

public override IPermission Copy()

Return Value

Type: System.Security.IPermission

A new instance of the SocketPermission class that is a copy of the current instance.

The object returned by this method represents the same level of access as the current instance. This method overrides Copy and is implemented to support the IPermission interface.

The following example creates a SocketPermission by taking a copy of an existing SocketPermission.

// Creates a copy of the intersect SocketPermission.
     SocketPermission mySocketPermissionIntersectCopy = 

     if (mySocketPermissionIntersectCopy.Equals(mySocketPermissionIntersect)){
     Console.WriteLine("Copy successfull");

.NET Framework
Available since 1.1
Return to top