如何在C#中恢复已删除的文件?
问题描述:
如何使用C#'取消删除'文件?
How can I 'undelete' files using C#?
答
您可以访问回收站的特殊文件夹。我不知道具体的名称,但它应该很容易找到谷歌。
You could access the special folder for the recycle bin. I don't know the name specifically, but it should be easy to find with google.
这可能会给你一些提示: http://stackoverflow.com/questions/1352550/how-can-i-undelete-a-file-using-c [ ^ ]
This may give you some hints: http://stackoverflow.com/questions/1352550/how-can-i-undelete-a-file-using-c[^]
如果您的文件被删除,而不仅仅是在回收站中,那么您不能。至少,不是没有做太多p / invoke,你也可以用c ++编写你的程序。这不是微不足道的,它涉及低级磁盘访问。
If your file is deleted, not just in the recycle bin, then you can't. At least, not without doing so much p/invoke that you may as well write your program in c++. It's not trivial, it involves low level disk access.