/// <summary>
        /// 创建文件路径
        /// </summary>
        /// <param name="filepath"></param>
        /// <returns></returns>
        private void CreatePath(string filepath)
        {
            if (!Directory.Exists(filepath))
            {
                var securityRules = new DirectorySecurity();
                securityRules.AddAccessRule(new FileSystemAccessRule(System.Environment.UserName, FileSystemRights.FullControl, AccessControlType.Allow));
                securityRules.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.FullControl, AccessControlType.Allow));
                securityRules.AddAccessRule(new FileSystemAccessRule("NETWORK SERVICE", FileSystemRights.FullControl, AccessControlType.Allow));
                Directory.CreateDirectory(filepath, securityRules);
            }

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2022-01-07
  • 2022-01-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-09-15
  • 2022-01-02
  • 2022-12-23
相关资源
相似解决方案