码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2019-06-11 11:21:13      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:for   can   wing   sage   获取   nts   ram   profile   document   

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;

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

标签:for   can   wing   sage   获取   nts   ram   profile   document   

原文地址:https://www.cnblogs.com/chucklu/p/11002273.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!