从回收站删除单个项目
C# 中是否有任何方法(可能是互操作)可以永久删除回收站中的特定文件?
在互联网上搜索时,我只找到了删除“到”回收站的方法,而不是“从”删除的方法。 我也不想清空整个垃圾箱,只想清空一个特定文件。 该特定项目已在回收站中。
我怎样才能做到这一点?
编辑:
- 我自己没有把文件放在那里,我的程序也没有放在那里。 别人这么做了,所以我无法控制。
- Windows 搜索以某种方式能够找到我的文件...?!?
我发现了另一件事,我实际上可以在 C:\RECYCLER 中找到一个具有相同文件扩展名但名称不同的文件。 那么我如何判断这是否真的是我正在寻找的文件呢?
Is there any way in C# (interop maybe) to delete a specific file in the recycle bin permanently?
While searching on the internet I only found ways to delete TO the recycle bin not FROM.
I also don't want to empty the whole bin, just one specific file. The specific item is already in the recycle bin.
How can I do this?
EDIT:
- I didn't put the file there myself, nor my program. Somebody else did so I have no control over that.
- Windows Search somehow is able to find my file...?!?
I found out another thing, I can actually find a file in C:\RECYCLER with the same file extension but a different name. So how can I tell if that is really the file I'm looking for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要参考:
代码:
希望这可能有所帮助。 对我有用。
You need to reference:
Code:
Hopefully that may be helpful. Works for me.
我从未尝试过,但您可以在每个单元都有的隐藏文件夹“RECYCLER”中搜索要删除的项目,并将其删除。
I never tried it but you can search for the item you want to delete in the hidden folder "RECYCLER" that each unit has, and delete it.
这可能是一个愚蠢的问题,但是该文件是否因为您的程序将其放在那里而进入了回收站? 如果是这样,您可以使用正常的文件操作删除该文件并完全绕过回收站。
This may be a stupid question, but did the file go into the recycle because your program put it there? If so, you can just delete the file using normal file operations and bypass the recycle bin entirely.