Getting Recent folders and Recent files in Windows XP
i wrote some code to get Recent folders and files in C# by using
Direc开发者_C百科toryInfo d = new DirectoryInfo(
System.Environment.GetFolderPath(
Environment.SpecialFolder.Recent)).
It is working fine in windows 7.But it is not working in windows xp.
Because there is no folder with "C:\Users\AppData\Roaming\Microsoft\Windows\Recent" in XP. Then how to get recent files in windows xp?On Windows XP, System.Environment.GetFolderPath(Environment.SpecialFolder.Recent)
will not return "C:\Users\AppData\Roaming\Microsoft\Windows\Recent", it returns the correct path. In my case this is "C:\Documents and Settings\daniel.hilgarth\Recent".
For getting recent file folder in Windows use the following command,
%AppData%\Microsoft\Windows\Recent\
精彩评论