Reputation: 13184
I would like to get a list of the files which have been opened by the user a) recently and/or b) frequently.
Is this information available on Windows operating systems (Need support for everything down to XP) and if yes, is there a way to use this data with .NET Framework?
Searching the topic on Google is kind of hard, because the results are always referring to solutions where people want to achieve the same thing for their own application only (i.e. create a list of recently used files). I need the same thing on OS level, not just for files which have been opened with the appplication created by me.
Upvotes: 2
Views: 658
Reputation: 31847
An easy solution can be to use Environment.SpecialFolder.Recent
:
string path = Environment.GetFolderPath(
Environment.SpecialFolder.Recent);
var files = Directory.EnumerateFiles(path);
Note that this solution only lists the recent opened documents. If you want a better solution, you can take a look to this article about how to use the Windows.Storage.AccessCache
API:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh972344.aspx
Upvotes: 3