Stop other c# programs from resetting the permissions of a file
<p>I used this code to deny permissions to a file. It worked perfectlly.       </p>

<pre><code>string fileName = @"c:\untitled.jpg";
FileSecurity fSecurity = File.GetAccessControl(fileName);
fSecurity.AddAccessRule(new FileSystemAccessRule("Everyone",    
                        FileSystemRights.FullControl, AccessControlType.Deny));
File.SetAccessControl(fileName, fSecurity);
</code></pre>

<p>and the below piece of code to reset the access controls</p>

<pre><code>fSecurity.ResetAccessRule(new FileSystemAccessRule("Everyone", 
                     FileSystemRights.FullControl, AccessControlType.Allow));
</code></pre>

<p>Now when I set permissions to a file. I dont want some other people to reset the permissions to the file but when I opened a new project and copied the code to reset acess rules to the file, it has reset the permissions to the file. I dont want that to be happen. </p>

<p>I only want my c# code to reset the permissions of the file because the people who knows the c# programming can easily reset the permissions to a file that has been denied with my c# code.</p>

<p>Can i block some one else from resetting the permissions a file through my c# code? The file permissions should be reset only through my c# code. Please help me with these. Thanks</p>
