C# - Deleting a file permanently

后端 未结 2 1151
情深已故
情深已故 2020-12-10 19:49

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

2条回答
  •  醉酒成梦
    2020-12-10 20:22

    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

提交回复
热议问题