I\'ve been out of the C# game for a while since I started iPhone stuff, but how can you delete a file completely (so its not stored in memory) and isn\'t recoverable. If you
It's certainly possible to overwrite a file so that the previous content cannot be recovered. But this has to be done by the drive itself to make sure the correct block is overwritten... C# interacts with the filesystem, not physical blocks, so won't provide any security.
The actual way to ask a drive to securely erase something varies with interface (ATAPI vs SATA, vs USB mass-storage vs SCSI vs firewire), and C# doesn't provide a simple way of commanding at this level.
sdelete
run this command via Process in c#.
Process p = new Process();
p.StartInfo = new ProcessStartInfo( "cmd", "/c sdelete -p 1 -s -z -q -a 'path/to/director' )
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
sdelete
can be downloaded here