注意:此构造函数在 .NET Framework 2.0 版中是新增的。
使用以下内容初始化
FileSystemAccessRule 类的新实例:用户帐户的名称、指定与访问规则关联的操作的类型的值、确定如何继承权限的值、确定如何传播权限的值,以及指定是允许还是拒绝该操作的值。
命名空间:System.Security.AccessControl
程序集:mscorlib(在 mscorlib.dll 中)
Public Sub New ( _
identity As String, _
fileSystemRights As FileSystemRights, _
inheritanceFlags As InheritanceFlags, _
propagationFlags As PropagationFlags, _
type As AccessControlType _
)
Dim identity As String
Dim fileSystemRights As FileSystemRights
Dim inheritanceFlags As InheritanceFlags
Dim propagationFlags As PropagationFlags
Dim type As AccessControlType
Dim instance As New FileSystemAccessRule(identity, fileSystemRights, inheritanceFlags, propagationFlags, type)
public FileSystemAccessRule (
string identity,
FileSystemRights fileSystemRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags,
AccessControlType type
)
public:
FileSystemAccessRule (
String^ identity,
FileSystemRights fileSystemRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags,
AccessControlType type
)
public FileSystemAccessRule (
String identity,
FileSystemRights fileSystemRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags,
AccessControlType type
)
public function FileSystemAccessRule (
identity : String,
fileSystemRights : FileSystemRights,
inheritanceFlags : InheritanceFlags,
propagationFlags : PropagationFlags,
type : AccessControlType
)
参数
- identity
用户帐户的名称。
- fileSystemRights
FileSystemRights 值之一,该值指定与访问规则关联的操作的类型。
- inheritanceFlags
InheritanceFlags 值之一,该值指定访问掩码如何传播到子对象。
- propagationFlags
PropagationFlags 值之一,该值指定访问控制项 (ACE) 如何传播到子对象。
- type
AccessControlType 值之一,该值指定是允许还是拒绝该操作。
使用此构造函数创建一条访问控制规则,使用 FileSecurity 或 DirectorySecurity 类可将该规则持久保存。访问控制规则定义用户帐户权限,这些权限确定在运行 Microsoft Windows 的计算机上允许或禁止哪些操作。
identity 参数必须标识当前机器或域上的有效帐户。该字符串采用如下格式(其中 DOMAIN 是有效域的名称或计算机名称,account 是域或计算机上有效用户帐户的名称):DOMAIN\account。
Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
.NET Framework
受以下版本支持:2.0