FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) Method

定義

從目前的檔案或目錄中,移除指定之使用者的所有存取控制清單 (ACL) 使用權限。Removes all access control list (ACL) permissions for the specified user from the current file or directory.

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 FileSystemAccessRule FileSystemAccessRule

FileSystemAccessRule 物件,指定應該從檔案或目錄中移除其存取控制清單 (ACL) 使用權限的使用者。A FileSystemAccessRule object that specifies a user whose access control list (ACL) permissions should be removed from a file or directory.

例外狀況

備註

RemoveAccessRuleAll方法會移除指定使用者的所有存取控制清單 (ACL) 許可權。The RemoveAccessRuleAll method removes all access control list (ACL) permissions for the specified user. 方法會忽略使用者帳戶以外的FileSystemAccessRule物件中的所有值。The method ignores all values in the FileSystemAccessRule object except the user account.

若要將新的或變更的 ACL 資訊保存至檔案SetAccessControl , SetAccessControl請使用或方法。To persist new or changed ACL information to a file, use the SetAccessControl or SetAccessControl method. 若要將新的或變更的 ACL 資訊保存至目錄SetAccessControl , SetAccessControl請使用或方法。To persist new or changed ACL information to a directory, use the SetAccessControl or SetAccessControl method.

若要從檔案取出 ACL 資訊, 請使用GetAccessControlGetAccessControl方法。To retrieve ACL information from a file, use the GetAccessControl or GetAccessControl method. 若要從目錄取出 ACL 資訊, 請使用GetAccessControlGetAccessControl方法。To retrieve ACL information from a directory, use the GetAccessControl or GetAccessControl method.

當您新增存取規則但未設定Synchronize旗標時, 旗標會自動新增到您的Synchronize規則。When you add an access rule without setting the Synchronize flag, the Synchronize flag will be automatically added to your rule. 如果您稍後不指定Synchronize旗標而移除規則, 則會自動移除旗標。If you remove the rule later without specifying the Synchronize flag, the flag will automatically be removed.

適用於