SocketPermission.Copy Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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 = 
                               (SocketPermission)mySocketPermissionIntersect.Copy();

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

.NET Framework
Available since 1.1
Return to top
Show: