如何在C#中恢复已删除的文件? [英] How do I recover deleted files in C#?

查看:253
本文介绍了如何在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.


这篇关于如何在C#中恢复已删除的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆