diff --git a/Apewer.Windows/WindowsUtility.cs b/Apewer.Windows/WindowsUtility.cs index 0844ce6..e0410b2 100644 --- a/Apewer.Windows/WindowsUtility.cs +++ b/Apewer.Windows/WindowsUtility.cs @@ -963,6 +963,15 @@ namespace Apewer #region 注册表。 + /// 获取当前用户 Downloads 目录的路径。 + public static string GetDownloadsDirectory() + { + const string key = @"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"; + const string name = "{374DE290-123F-4565-9164-39C4925E467B}"; + var value = RegistryHelper.GetString(RegistryHelper.CurrentUser, key, name); + return value; + } + /// 获取用于记录卸载信息的注册表路径。 public static string[] GetUnInstallPath() {