/// <summary>
/// 设置文件夹权限,处理为Everyone所有权限
/// </summary>
/// <param name="foldPath">文件夹路径</param>
public static void SetFileRole(string foldPath)
{
DirectorySecurity fsec = new DirectorySecurity();
fsec.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.FullControl,
InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
System.IO.Directory.SetAccessControl(foldPath, fsec);
}
C#设置文件夹权限,处理为Everyone所有权限
最新推荐文章于 2024-04-24 14:26:05 发布