SecurityAttribute.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 值之一。

示例

下面的代码示例演示指定值的典型权限 SecurityAction 。 此值将用于设置 Action 属性。

[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

注解

此属性由实现声明性安全性的自定义属性的所有类继承。

适用于