get the date when the file was sent to recycle bin

孤街浪徒 提交于 2019-12-07 09:22:56

问题


Is there any call which will get the date when the file was sent to recycle bin.

Items object in Shell32 gives the lastmodified date but not when it is sent to recycle bin.

I want to be able to restore files deleted on a particular date.


回答1:


OK - as usual it is very simple when you know how. I was thinking this would be a property of the file - but it is not - it is a property of the recycle bin.

So once a link to the recycle bin has been got:

var Shl = new Shell();
Folder Recycler = Shl.NameSpace(10); 
FI = Recycler.Items().Item(0);   
string FileName = Recycler.GetDetailsOf(FI, 0); 
string FilePath = Recycler.GetDetailsOf(FI, 1); 
string RecyleDate = Recycler.GetDetailsOf(FI, 2); 

The lastmodified date is a separate property that refers solely to the deleted file.



来源:https://stackoverflow.com/questions/12871456/get-the-date-when-the-file-was-sent-to-recycle-bin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!