How to roll back file delete operation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srinivasanr
    New Member
    • Jan 2009
    • 9

    How to roll back file delete operation

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

    I am deleting file using this code,

    Code:
    File.Delete(fileName);
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    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 ...

    Comment

    • shweta123
      Recognized Expert Contributor
      • Nov 2006
      • 692

      #3
      Hi,

      Please refer the following link for your requirement:

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        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.

        Comment

        Working...