How do I restore a file from the recycle bin using C#?

前端 未结 3 1654
无人共我
无人共我 2020-12-02 01:39

Moving files to the recycle bin and emptying the recycle bin are well documented, but how can a file be programmatically restored from the recycle bin?

3条回答
  •  眼角桃花
    2020-12-02 02:10

    There seems not to be a solution in pure C#. You most likely have to resort to P/Invoke. This article presents a solution in C++ using the SHFileOperation API.

提交回复
热议问题