zoukankan      html  css  js  c++  java
  • C#指定某用户对某文夹件的访问权限


          using System.Security.AccessControl;

                    //设置myFloder文件夹的iis访问权限
                    string userAccount = @"IIS_IUSRS";
                    string filePath = @"C:inetpubmyFloder";
                    DirectorySecurity dSecurity = Directory.GetAccessControl(filePath,
                            AccessControlSections.All);

                    dSecurity.AddAccessRule(new FileSystemAccessRule(userAccount,
                                           FileSystemRights.FullControl,
                                           InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
                                           PropagationFlags.None,
                                           AccessControlType.Allow));
                    Directory.SetAccessControl(filePath, dSecurity);

  • 相关阅读:
    元宇宙通证
    高性能公链
    区块链不可能三角
    搭建自己的在线API文档系统
    windows 安装python环境
    golang beego项目的正确开启方法
    人生发财靠康波
    蒙代尔不可能三角
    Kubernetes 部署Dashboard UI
    Kubernetes 使用kubeadm创建集群
  • 原文地址:https://www.cnblogs.com/tianmochou/p/5099609.html
Copyright © 2011-2022 走看看