FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) 方法

定義

移除指定使用者目前檔案或目錄中所有存取控制清單(ACL)權限。

public:
 void RemoveAccessRuleAll(System::Security::AccessControl::FileSystemAccessRule ^ rule);
public void RemoveAccessRuleAll(System.Security.AccessControl.FileSystemAccessRule rule);
override this.RemoveAccessRuleAll : System.Security.AccessControl.FileSystemAccessRule -> unit
Public Sub RemoveAccessRuleAll (rule As FileSystemAccessRule)

參數

rule
FileSystemAccessRule

一個 FileSystemAccessRule 指定應從檔案或目錄移除存取控制清單(ACL)權限的使用者的物件。

例外狀況

參數 rulenull

備註

RemoveAccessRuleAll 方法會移除指定使用者的所有存取控制清單(ACL)權限。 此方法忽略物件中 FileSystemAccessRule 除使用者帳號外的所有值。

請使用以下依實作而依據 .NET 的方法,從檔案中新增或擷取 ACL 資訊:

.NET 實作 新增規則 回收規則
.NET FileSystemAclExtensions.SetAccessControl(FileInfo, FileSecurity) FileSystemAclExtensions.GetAccessControl(FileInfo)
.NET Framework FileInfo.SetAccessControl(FileSecurity) FileInfo.GetAccessControl()

當你在沒有設定 Synchronize 旗標的情況下新增存取規則時,該 Synchronize 旗標會自動加入你的規則中。 如果你之後移除規則且未指定旗標, Synchronize 該旗幟將自動被移除。

適用於