title: Securely erasing a file using simple methods?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3330427/c-deleting-a-file-permanently">C# - Deleting a file permanently </a>  </p>
  </blockquote>
  
  
  
  <p>Hello,</p>
  
  <p>I am using C# .NET Framework 2.0. I have a question relating to file shredding. </p>
  
  <p>My target operating systems are Windows 7, Windows Vista, and Windows XP. Possibly Windows Server 2003 or 2008 but I'm guessing they should be the same as the first three.</p>
  
  <p>My goal is to securely erase a file. </p>
  
  <p>I don't believe using File.Delete is secure at all. I read somewhere that the operating system simply marks the raw hard-disk data for deletion when you delete a file - the data is not erased at all. That's why there exists so many working methods to recover supposedly "deleted" files. I also read, that's why it's much more useful to overwrite the file, because then the data on disk actually has to be changed. <em>Is this true? Is this generally what's needed?</em> </p>
  
  <p>If so, I believe I can simply write the file full of 1's and 0's a few times. </p>
  
  <p>I've read:
  <a href="http://www.codeproject.com/KB/files/NShred.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/files/NShred.aspx</a>
  <a href="http://blogs.computerworld.com/node/5756" rel="nofollow noreferrer">http://blogs.computerworld.com/node/5756</a>
  <a href="http://blogs.computerworld.com/node/5687" rel="nofollow noreferrer">http://blogs.computerworld.com/node/5687</a>
  <a href="https://stackoverflow.com/questions/4147775/securely-deleting-a-file-in-c-net">Securely deleting a file in C#.NET</a></p>