string path = @"F:\Kishfolder"; DirectoryInfo dinfo = new DirectoryInfo(path); DirectorySecurity dirSecurity = dinfo.GetAccessControl(); FileSystemAccessRule fileRule = new FileSystemAccessRule("Everyone", FileSystemRights.Modify | FileSystemRights.FullControl | FileSystemRights.Synchronize, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow); dirSecurity.AddAccessRule(fileRule); dirSecurity.SetAccessRule(fileRule); Directory.SetAccessControl(path, dirSecurity); dinfo.Refresh();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)