C#如何获取系统downloads和documents路径

https://*.com/questions/7672774/how-do-i-determine-the-windows-download-folder-path

如果你通过文件夹的location属性,移动了文件夹。

比如之前在%userProfile%\downloads,被移动到了c:\workspace\clu\downloads

You can use the Windows API Code Pack for Microsoft .NET Framework.

Reference: Microsoft.WindowsAPICodePack.Shell.dll

Need the following namespace:

using Microsoft.WindowsAPICodePack.Shell;

Simple usage:

string downloadsPath = KnownFolders.Downloads.Path;

C#如何获取系统downloads和documents路径

上一篇:如何真正实现由文档驱动的API设计?


下一篇:C#XmlDocument输出字符串