FileSystemSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) FileSystemSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) FileSystemSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) Method

定義

初始化 FileSystemAuditRule 類別 (表示指定之使用者的指定稽核規則) 的新執行個體。Initializes a new instance of the FileSystemAuditRule class representing the specified audit rule for the specified user.

public:
 override System::Security::AccessControl::AuditRule ^ AuditRuleFactory(System::Security::Principal::IdentityReference ^ identityReference, int accessMask, bool isInherited, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags, System::Security::AccessControl::AuditFlags flags);
public override sealed System.Security.AccessControl.AuditRule AuditRuleFactory (System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AuditFlags flags);
override this.AuditRuleFactory : System.Security.Principal.IdentityReference * int * bool * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags * System.Security.AccessControl.AuditFlags -> System.Security.AccessControl.AuditRule

參數

identityReference
IdentityReference IdentityReference IdentityReference

IdentityReference 物件,表示使用者帳戶。An IdentityReference object that represents a user account.

accessMask
Int32 Int32 Int32

整數,指定存取類型。An integer that specifies an access type.

isInherited
Boolean Boolean Boolean

如果繼承存取規則,則為 true,否則為 falsetrue if the access rule is inherited; otherwise, false.

inheritanceFlags
InheritanceFlags InheritanceFlags InheritanceFlags

其中一個 InheritanceFlags 值,指定存取遮罩要如何散佈到子物件。One of the InheritanceFlags values that specifies how to propagate access masks to child objects.

propagationFlags
PropagationFlags PropagationFlags PropagationFlags

其中一個 PropagationFlags 值,指定存取控制項目 (ACE) 要如何散佈到子物件。One of the PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.

flags
AuditFlags AuditFlags AuditFlags

其中一個 AuditFlags 值,指定要執行之稽核的類型。One of the AuditFlags values that specifies the type of auditing to perform.

傳回

新的 FileSystemAuditRule 物件,表示指定之使用者的指定稽核規則。A new FileSystemAuditRule object representing the specified audit rule for the specified user.

例外狀況

accessMaskinheritanceFlagspropagationFlagsflags 屬性指定了無效值。The accessMask, inheritanceFlags, propagationFlags, or flags properties specify an invalid value.

identityReference 屬性為 nullThe identityReference property is null.

-或--or- accessMask 屬性為零。The accessMask property is zero.

identityReference 屬性既不是 SecurityIdentifier 型別,也不是可以轉換成 NTAccount 型別的型別 (例如 SecurityIdentifier)。The identityReference property is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier.

備註

建立 audit 規則的建議方式是使用FileSystemAuditRule類別的函式。The recommended way to create audit rules is to use the constructors of the FileSystemAuditRule class.

AuditRuleFactory方法的傳回型別是基類, AuditRule但傳回值可以安全地轉換成衍生的類別。The return type of the AuditRuleFactory method is the base class, AuditRule, but the return value can be cast safely to the derived class.

適用於