public sealed class WebPermissionAttribute : CodeAccessSecurityAttribute
Object
Attribute
SecurityAttribute
CodeAccessSecurityAttribute
WebPermissionAttribute
System
Networking
Used to declaratively specify permission to access Internet resources.
[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, WebPermission .The allowable WebPermissionAttribute targets are determined by the SecurityAction passed to the constructor.
]
AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)
System.Net Namespace
WebPermissionAttribute Constructors
WebPermissionAttribute Constructor
WebPermissionAttribute Methods
WebPermissionAttribute.CreatePermission Method
WebPermissionAttribute Properties
WebPermissionAttribute.Accept Property
WebPermissionAttribute.Connect Property
public WebPermissionAttribute(SecurityAction action);
Constructs a new instance of the WebPermissionAttribute class with the specified SecurityAction value.
- action
- A SecurityAction value.
Exception Type Condition ArgumentException action is not a valid SecurityAction value.
System.Net.WebPermissionAttribute Class, System.Net Namespace
public override IPermission CreatePermission();
Returns a WebPermission instance that contains the security information of the current instance.
A WebPermission object with the security information of the current instance.
[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.
]
System.Net.WebPermissionAttribute Class, System.Net Namespace
public string Accept { get; set; }
Gets or sets the URI accepted by the current instance.
A String that represents the URI accepted by the current instance.
Exception Type Condition ArgumentException System.Net.WebPermissionAttribute.Acceptis being set and is not null
.
This property is write-once. Once this property has been set to a non-null value, attempts to set this property to new value cause a ArgumentException .
System.Net.WebPermissionAttribute Class, System.Net Namespace
public string Connect { get; set; }
Gets or sets the URI connection controlled by the current instance.
A String that represents the connection controlled by the current instance.
Exception Type Condition ArgumentException System.Net.WebPermissionAttribute.Connect is being set and is not null
.
This property is write-once. Once this property has been set to a non-null value, attempts to set this property to new value cause a ArgumentException .
System.Net.WebPermissionAttribute Class, System.Net Namespace