title: Attempted to perform an unauthorized operation error when trying to delete a file form server
body: <p>I am in asp.net, C#, .net FrameWork 4.0
  I have a file in my downloads folder in my webhost that i can't delete it now! i can delete any other files, but just this one and one or two more files has such this problem.</p>
  
  <p>I don't know the reason... but i think there is a problem in the file security.
  When i attemp to delete the file with this way:</p>
  
  <pre><code>FileInfo fi = new FileInfo("file.dat");
  if (fi.Exists) fi.Delete();
  </code></pre>
  
  <p>The file name and the path is correct and available in the path.
  so fi.Exists returns true then fi.Delete executes...
  but raises this error "Access to the path ... is denied!"</p>
  
  <p>I thought that the permission for my app is limited and can not delete the file.
  So i decided to set a FullControl permission to the file like this:</p>
  
  <pre><code>FileInfo fi = new FileInfo("file.dat");
  FileSecurity sec = fi.GetAccessControl();
  sec.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.FullControl, AccessControlType.Allow));
  fi.SetAccessControl(sec);
  </code></pre>
  
  <p>but now, raises this error: <strong>Attempted to perform an unauthorized operation</strong></p>
  
  <p>Where is the problem...???
  How can i allow my app to delete all files without problem...???
  Pleas help me sooner...
  Thanx...</p>