System.Net.SocketPermission.IsSubsetOf Method

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

Syntax

public override bool IsSubsetOf (System.Security.IPermission target)

Parameters

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

Returns

If target is null, this method returns true if the current instance defines no permissions; otherwise, false. If target is not null, this method returns true if the current instance defines a subset of target permissions; otherwise, false.

Exceptions

TypeReason
ArgumentException target is not null and is not of type System.Net.SocketPermission.

Remarks

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.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0