繁体   English   中英

在Windows XP中获取最近的文件夹和最近的文件

[英]Getting Recent folders and Recent files in Windows XP

我写了一些代码来使用C#获取最近的文件夹和文件

DirectoryInfo d = new DirectoryInfo(
                          System.Environment.GetFolderPath(
                              Environment.SpecialFolder.Recent)).

它在Windows 7中工作正常。但它不能在Windows XP中工作。
因为XP中没有“C:\\ Users \\ AppData \\ Roaming \\ Microsoft \\ Windows \\ Recent”的文件夹。 那么如何在windows xp中获取最近的文件?

在Windows XP上, System.Environment.GetFolderPath(Environment.SpecialFolder.Recent)不会返回“C:\\ Users \\ AppData \\ Roaming \\ Microsoft \\ Windows \\ Recent”,它将返回正确的路径。 在我的例子中,这是“C:\\ Documents and Settings \\ daniel.hilgarth \\ Recent”。

要在Windows中获取最近的文件夹,请使用以下命令:

%AppData%\Microsoft\Windows\Recent\

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM