In a project I am doing I want to give users the option of ‘securely’ deleting a file – as in, overwriting it with random bits or 0’s. Is there an easy-ish way of doing this in C#.NET? And how effective would it be?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could invoke sysinternals SDelete to do this for you. This uses the defragmentation API to handle all those tricky edge cases.
If you want to repackage that logic in a more convenient form, the API is described here.