FileSystemSecurity.RemoveAccessRuleSpecific(FileSystemAccessRule) 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從目前檔案或目錄移除單一相符的允許或拒絕訪問控制清單 (ACL) 許可權。
public:
void RemoveAccessRuleSpecific(System::Security::AccessControl::FileSystemAccessRule ^ rule);
C#
public void RemoveAccessRuleSpecific(System.Security.AccessControl.FileSystemAccessRule rule);
override this.RemoveAccessRuleSpecific : System.Security.AccessControl.FileSystemAccessRule -> unit
Public Sub RemoveAccessRuleSpecific (rule As FileSystemAccessRule)
- rule
- FileSystemAccessRule
FileSystemAccessRule 物件,指定應該從檔案或目錄移除其訪問控制清單 (ACL) 權限的使用者。
rule
參數是 null
。
RemoveAccessRuleSpecific 方法會從目前 FileSystemSecurity 物件中移除指定的 Deny 存取規則或指定的相符 Allow 存取規則。 例如,您可以藉由傳遞使用 Deny 值、Read 值和用戶帳戶建立的 FileSystemAccessRule 物件,來移除使用者的指定 Deny 存取規則。 當您這樣做時,RemoveAccessRuleSpecific 方法只會移除指定 Read 值的拒絕規則。 它不會移除任何指定 Write 值的拒絕規則。
使用下列 .NET 實作相依方法,從檔案新增或擷取 ACL 資訊:
當您新增存取規則而不設定 Synchronize 旗標時,會自動將 Synchronize 旗標新增至您的規則。 如果您稍後移除規則而不指定 Synchronize 旗標,則會自動移除旗標。
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5 |