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);

  • 相关阅读:
    LR三:post接口_ajax上传
    LR二:post接口_form表单上传
    Dijkstra优先队列优化
    Misha and Changing Handles
    HDU-1428(记忆化搜索)
    CF-599B
    POJ-1488(字符串应用)
    New Year Permutation(Floyd+并查集)
    HDU-1078
    HDU-5532(LIS-nlogn)
  • 原文地址:https://www.cnblogs.com/tianmochou/p/5099609.html
Copyright © 2011-2022 走看看