SecurityAttribute.Action SecurityAttribute.Action SecurityAttribute.Action SecurityAttribute.Action Property

定义

获取或设置安全性操作。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值。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.

适用于