By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

How to roll back file delete operation

P: 9
I want to roll back file delete operaion using c#. How can i do it?

I am deleting file using this code,

Expand|Select|Wrap|Line Numbers
  1. File.Delete(fileName);
Feb 24 '09 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 750
I don't think you can "rollback" or retrieve deleted file... You can however read the contents of file in byte array and keep in memory in case you want to recreate the file ...
Feb 24 '09 #2

Expert 100+
P: 692

Please refer the following link for your requirement:
Feb 24 '09 #3

Expert 2.5K+
P: 3,525
If you have to be able to "undelete" maybe you could move items to the trash can rather than do File.Delete(). That way you can move them back out of the trash.
Feb 25 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.