System.Net.DnsPermission Class

public class DnsPermission : CodeAccessPermission

Base Types

Object
  CodeAccessPermission
    DnsPermission

This type implements IPermission.

Assembly

System

Library

Networking

Summary

Controls access to Domain Name System (DNS) servers on the network.

Description

The XML encoding of a DnsPermission instance is defined below in EBNF format. The following conventions are used:

The following meta-language symbols are used:

BuildVersion refers to the build version of the shipping CLI. This is a dotted build number such as '2412.0' .

ECMAPubKeyToken ::= b77a5c561934e089

DnsPermissionXML ::=

<IPermission

class="

System.Net.DnsPermission,

System,

Version=1.0. BuildVersion,

Culture=neutral,

PublicKeyToken= ECMAPubKeyToken"

version="1"

(

Unrestricted="true"/>

)

| />

See Also

System.Net Namespace

Members

DnsPermission Constructors

DnsPermission Constructor

DnsPermission Methods

DnsPermission.Copy Method
DnsPermission.FromXml Method
DnsPermission.Intersect Method
DnsPermission.IsSubsetOf Method
DnsPermission.ToXml Method
DnsPermission.Union Method


DnsPermission Constructor

public DnsPermission(PermissionState state);

Summary

Constructs and initializes a new instance of the DnsPermission class with the specified PermissionState value.

Parameters

state
A PermissionState value.

Exceptions

Exception TypeCondition
ArgumentExceptionstate is not a valid PermissionState value.

Description

[Note: This constructor creates either fully restricted (System.Security.Permissions.PermissionState.None) or System.Security.Permissions.PermissionState.Unrestricted access to DNS information.

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.Copy Method

public override IPermission Copy();

Summary

Returns a new DnsPermission object containing the same values as the current instance.

Return Value

A new DnsPermission instance containing the same values as the current instance.

Description

[Note: The object returned by this method represents the same access to DNS information as the current instance.

This method overrides System.Security.CodeAccessPermission.Copy and is implemented to support the IPermission interface.

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.FromXml Method

public override void FromXml(SecurityElement securityElement);

Summary

Reconstructs the state of a DnsPermission object using the specified XML encoding.

Parameters

securityElement
A SecurityElement instance containing the XML encoding to use to reconstruct the state of a DnsPermission object.

Exceptions

Exception TypeCondition
ArgumentNullExceptionsecurityElement is null

ArgumentExceptionsecurityElement is not a DnsPermission element.

Description

The state of the current instance is changed to the state encoded in securityElement.

[Note: For the XML encoding for this class, see the DnsPermission class page.

This method overrides System.Security.CodeAccessPermission.FromXml(System.Security.SecurityElement) .

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.Intersect Method

public override IPermission Intersect(IPermission target);

Summary

Returns a new DnsPermission object that is the intersection of the current instance and the specified object.

Parameters

target
A DnsPermission instance to intersect with the current instance.

Return Value

A new DnsPermission instance that represents the intersection of the current instance and target. If the intersection is empty, returns null . If the current instance is unrestricted, returns a copy of target. If target is unrestricted, returns a copy of the current instance.

Description

[Note: The intersection of two permissions is a permission that secures the resources and operations secured by both permissions. Specifically, it represents the minimum permission such that any demand that passes both permissions will also pass their intersection.

This method overrides System.Security.CodeAccessPermission.Intersect(System.Security.IPermission) and is implemented to support the IPermission interface.

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.IsSubsetOf Method

public override bool IsSubsetOf(IPermission target);

Summary

Determines whether the current instance is a subset of the specified object.

Parameters

target
A DnsPermission instance that is to be tested for the subset relationship.

Return Value

true if the current instance is a subset of target ; otherwise, false . If the current instance is unrestricted, and target is not, returns false . If target is unrestricted, returns true . If target is null , returns false .

Description

[Note: The current instance is a subset of target if the current instance specifies a set of accesses to resources that is wholly contained by target. For example, a permission that represents read access to a file is a subset of a permission that represents read and write access to the file.

This method overrides System.Security.CodeAccessPermission.IsSubsetOf(System.Security.IPermission) and is implemented to support the IPermission interface.

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.ToXml Method

public override SecurityElement ToXml();

Summary

Returns the XML encoding of the current instance.

Return Value

A SecurityElement containing the XML encoding of the state of the current instance.

Description

[Note: For the XML encoding for this class, see the DnsPermission class page.

This method overrides System.Security.CodeAccessPermission.ToXml .

]

See Also

System.Net.DnsPermission Class, System.Net Namespace

DnsPermission.Union Method

public override IPermission Union(IPermission target);

Summary

Returns a new DnsPermission object that is the union of the current instance and the specified object.

Parameters

target
A DnsPermission instance to combine with the current instance.

Return Value

A new DnsPermission instance that represents the union of the current instance and target. If the current instance or target is unrestricted, returns a DnsPermission instance that is unrestricted.

Description

[Note: The result of a call to System.Net.DnsPermission.Union(System.Security.IPermission) is a permission that represents all of the access to permissions represented by the current instance as well as the permissions represented by target. Any demand that passes either the current instance or target passes their union.

This method overrides System.Security.CodeAccessPermission.Union(System.Security.IPermission) and is implemented to support the IPermission interface.

]

See Also

System.Net.DnsPermission Class, System.Net Namespace