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

https://stackoverflow.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;
posted @ 2019-06-11 10:40  ChuckLu  阅读(2283)  评论(0)    收藏  举报