C#File.Delete恢复? [英] c# File.Delete recovery?

查看:906
本文介绍了C#File.Delete恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来恢复已经由 File.Delete()编程方法删除文件(S)?

Is there a way to recover file(s) that have been deleted programatically by the File.Delete() method?

一个程序删除了,我需要恢复一些文件,它们不会出现在回收站中。

A program has deleted some files that I need to recover and they do not appear in the recycle bin.

推荐答案

不。 File.Delete()调用API中,并绕过回收站硬删除。您将需要使用文件恢复计划,并希望最好的。

Nope. File.Delete() calls a hard delete within the API and by-passes the Recycle Bin. You will need to use a file recovery program and hope for the best.

有关通过使用回收站删除的 SHFileOperation API,因为它是外壳的一部分。

For deletion via the Recycle Bin you use the SHFileOperation API as it is part of the shell.

如果/当你有你的文件备份,你可能想看看这个苏答案,其中讨论了改变 File.Delete()的东西,使用回收站:

If/once you have your files back you might want to take a look at this SO answer which discusses changing File.Delete() to something that uses the Recycle Bin:

发送文件到回收站

这篇关于C#File.Delete恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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