title: Can't copy file with appropriate permissions using FileIOPermission
body: <p>This snippet works well if I try to write in a user directory but as soon as I try to write in Program Files, it just executes silently and the file has not been copied (no exception). If I try to copy the file in C:\ or in C:\Windows I catch an UnauthorizedAccessException.</p>
  
  <p>Do you know another way to get the permissions to write in that directory or to make it work another way?</p>
  
  <p>Any help greatly appreciated! Thanks</p>
  
  <pre><code>using(FileStream fs=File.Open(source, FileMode.Open)){ }  
  try  
  {  
      FileIOPermission fp = new FileIOPermission(FileIOPermissionAccess.Write,   
                            AccessControlActions.Change, "C:\\Program Files\\MyPath");  
      fp.Demand();  //&lt;-- no exception but file is not copied
      File.Copy("C:\\Users\\teebot\\Documents\\File.xml","C:\\Program Files\\MyPath\\File.xml",true);  
  }  
  catch(SecurityExceptions)  
  {  
      throw(s);  
  } 
  catch(UnauthorizedAccessException unauthroizedException)
  {
      throw unauthroizedException;
  }
  </code></pre>