Export (0) Print
Expand All

SocketPermission.IsSubsetOf Method

Determines if the current permission is a subset of the specified permission.

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

abstract IsSubsetOf : 
        target:IPermission -> bool  
override IsSubsetOf : 
        target:IPermission -> bool

Parameters

target
Type: System.Security.IPermission

A SocketPermission that is to be tested for the subset relationship.

Return Value

Type: System.Boolean
If target is a null reference (Nothing in Visual Basic), this method returns true if the current instance defines no permissions; otherwise, false. If target is not a null reference (Nothing in Visual Basic), this method returns true if the current instance defines a subset of target permissions; otherwise, false.

Implements

IPermission.IsSubsetOf(IPermission)

ExceptionCondition
ArgumentException

target is not a SocketException.

SecurityException

DnsPermission is not granted to the method caller.

The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission.

For example, a permission that represents access to 192.168.1.1:80 is a subset of a permission that represents access to 192.168.1.1:Any. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

The following example uses the IsSubsetOf method to determine if one SocketPermission is the subset of another.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft