System.Net.DnsPermissionAttribute Class

public sealed class DnsPermissionAttribute : CodeAccessSecurityAttribute

Base Types

Object
  Attribute
    SecurityAttribute
      CodeAccessSecurityAttribute
        DnsPermissionAttribute

Assembly

System

Library

Networking

Summary

Used to declaratively specify permission to request information from Domain Name Servers.

Description

[Note: The security information declared by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. Security attributes are used for declarative security only. For imperative security, use the corresponding permission class, DnsPermission .

The allowable DnsPermissionAttribute targets are determined by the SecurityAction passed to the constructor.

]

Attributes

AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)

See Also

System.Net Namespace

Members

DnsPermissionAttribute Constructors

DnsPermissionAttribute Constructor

DnsPermissionAttribute Methods

DnsPermissionAttribute.CreatePermission Method


DnsPermissionAttribute Constructor

public DnsPermissionAttribute(SecurityAction action);

Summary

Constructs a new instance of the DnsPermissionAttribute class with the specified SecurityAction value.

Parameters

action
A SecurityAction value.

Exceptions

Exception TypeCondition
ArgumentExceptionaction is not a valid SecurityAction value.

See Also

System.Net.DnsPermissionAttribute Class, System.Net Namespace

DnsPermissionAttribute.CreatePermission Method

public override IPermission CreatePermission();

Summary

Returns a DnsPermission instance that contains the security information of the current instance.

Return Value

A DnsPermission object with the security information of the current instance.

Description

[Note: Applications typically do not call this method; it is intended for use by the system.

The security information described by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. The system uses the object returned by this method to convert the security information of the current instance into the form stored in metadata.

This method overrides System.Security.Permissions.SecurityAttribute.CreatePermission.

]

See Also

System.Net.DnsPermissionAttribute Class, System.Net Namespace