SecurityAttribute.Action 属性

定义

获取或设置安全性操作。Gets or sets a security action.

public:
 property System::Security::Permissions::SecurityAction Action { System::Security::Permissions::SecurityAction get(); void set(System::Security::Permissions::SecurityAction value); };
public System.Security.Permissions.SecurityAction Action { get; set; }
member this.Action : System.Security.Permissions.SecurityAction with get, set
Public Property Action As SecurityAction

属性值

SecurityAction 值之一。One of the SecurityAction values.

示例

下面的代码示例演示指定 SecurityAction 值的典型权限。The following code example demonstrates a typical permission that specifies a SecurityAction value. 此值将用于设置 "Action" 属性。This value will be used to set the Action property.

[FileIOPermissionAttribute(SecurityAction::PermitOnly,ViewAndModify="C:\\example\\sample.txt")]
[FileIOPermissionAttribute(SecurityAction.PermitOnly, ViewAndModify = "C:\\example\\sample.txt")]
<FileIOPermissionAttribute(SecurityAction.PermitOnly, _
ViewAndModify:="C:\example\sample.txt")> Public Class SampleClass

注解

所有类都将继承此属性,实现声明性安全的自定义属性。This property is inherited by all classes implementing custom attributes for declarative security.

适用于