I need to give the "Temporary ASP.NET Files" folder write permission using C # ... and I use this code to give it access
DirectoryInfo d1 = new DirectoryInfo(Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "Temporary ASP.NET Files")); DirectorySecurity md1 = d1.GetAccessControl(); string user_1 = fa.TextGuestDomain + "\\" + fa.TextGuestUser; md1.AddAccessRule(new FileSystemAccessRule(user_1, FileSystemRights.FullControl,InheritanceFlags.ObjectInherit,PropagationFlags.InheritOnly, AccessControlType.Allow)); d1.SetAccessControl(md1);
When I checked the security properties for the ASP.NET Temporary Files folder after implementing the code, he did not check the “write permission” box, instead he checked the “special permissions” one ... I noticed that even when I changed the access from write full control or read it, he checked the "special permissions" one ....
This is not a problem :), the problem is that he does not give the correct access, which I give him ... when I let him write, it does not work if I give him permission to write. I do not know why! Am I doing it wrong?
Note: when I do this in manual mode of my work, and when using the encoding method. he does not work...
I hope you help me with this ...
thanks a lot
source share