문제

I just wanna ask if there's a possibility to retrieve the contents of a 'dump' file from the recycle bin programatically. The contents that I'm looking for are file attributes like 'Date Last Modified, 'Data created', 'size', etc (without restoring the file itself to the original location to preserve the original attributes found while inside the recycle bin.)

도움이 되었습니까?

해결책

This article should help you. As the guy pointed out in his article there is surely a P/Invoke solution but he couldn't find it.

다른 팁

There is a not direct c# solution. P/Invoke calls is one of the way.

The location of Recycle bin and other special folders used frequently by applications can be idenitified by CSIDL(Shell). For recycle bin the enum used is CSIDL_BITBUCKET. A CSIDL is used in conjunction with one of four Shell functions, SHGetFolderLocation, SHGetFolderPath, SHGetSpecialFolderLocation, and SHGetSpecialFolderPath, to retrieve a special folder's path.

The C++ implementaion can be found here: How to programmatically use the Recycle Bin

Some c# samples.

Recycle Bin file size and file count.
Empty Recycle Bin

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top