string redirectionFolder = @"D:\test\subtest\";
FileSystemAccessRule everyOne = new FileSystemAccessRule("Everyone", FileSystemRights.FullControl,AccessControlType.Allow);
DirectorySecurity dirSecurity = new DirectorySecurity(redirectionFolder, AccessControlSections.Group);
dirSecurity.AddAccessRule(everyOne);
Directory.SetAccessControl(redirectionFolder, dirSecurity);
Note:
If you get the error "Attempted to perform an unauthorized operation"
add the tag (<identity impersonate="true"/>) in your web.config file.
FileSystemAccessRule everyOne = new FileSystemAccessRule("Everyone", FileSystemRights.FullControl,AccessControlType.Allow);
DirectorySecurity dirSecurity = new DirectorySecurity(redirectionFolder, AccessControlSections.Group);
dirSecurity.AddAccessRule(everyOne);
Directory.SetAccessControl(redirectionFolder, dirSecurity);
Note:
If you get the error "Attempted to perform an unauthorized operation"
add the tag (<identity impersonate="true"/>
No comments:
Post a Comment