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

其中一個 SecurityAction 值。One of the SecurityAction values.

範例

下列程式碼範例示範指定值的一般許可權 SecurityActionThe 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.

適用於