<i id='h95oa'><tr id='h95oa'><dt id='h95oa'><q id='h95oa'><span id='h95oa'><b id='h95oa'><form id='h95oa'><ins id='h95oa'></ins><ul id='h95oa'></ul><sub id='h95oa'></sub></form><legend id='h95oa'></legend><bdo id='h95oa'><pre id='h95oa'><center id='h95oa'></center></pre></bdo></b><th id='h95oa'></th></span></q></dt></tr></i><div id='h95oa'><tfoot id='h95oa'></tfoot><dl id='h95oa'><fieldset id='h95oa'></fieldset></dl></div>

<small id='h95oa'></small><noframes id='h95oa'>

    1. <legend id='h95oa'><style id='h95oa'><dir id='h95oa'><q id='h95oa'></q></dir></style></legend>

      • <bdo id='h95oa'></bdo><ul id='h95oa'></ul>
      <tfoot id='h95oa'></tfoot>

        如何以编程方式将文件夹添加到用户的收藏夹(在 Windows 资源管理器中)?

        时间:2023-10-24
        <tfoot id='tJfoO'></tfoot>

      1. <i id='tJfoO'><tr id='tJfoO'><dt id='tJfoO'><q id='tJfoO'><span id='tJfoO'><b id='tJfoO'><form id='tJfoO'><ins id='tJfoO'></ins><ul id='tJfoO'></ul><sub id='tJfoO'></sub></form><legend id='tJfoO'></legend><bdo id='tJfoO'><pre id='tJfoO'><center id='tJfoO'></center></pre></bdo></b><th id='tJfoO'></th></span></q></dt></tr></i><div id='tJfoO'><tfoot id='tJfoO'></tfoot><dl id='tJfoO'><fieldset id='tJfoO'></fieldset></dl></div>

            <bdo id='tJfoO'></bdo><ul id='tJfoO'></ul>
            • <legend id='tJfoO'><style id='tJfoO'><dir id='tJfoO'><q id='tJfoO'></q></dir></style></legend>

                <tbody id='tJfoO'></tbody>

                • <small id='tJfoO'></small><noframes id='tJfoO'>

                  本文介绍了如何以编程方式将文件夹添加到用户的收藏夹(在 Windows 资源管理器中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找一种以编程方式将文件夹添加到 Windows 资源管理器中的收藏夹的方法.它的 Windows Explorer 特定并基于此项目:http:///www.codeproject.com/Tips/132804/Open-folders-using-a-Run-Command

                  I am looking for a way to programmatically add a folder to the Favorites in Windows Explorer. Its Windows Explorer specific and based around this project: http://www.codeproject.com/Tips/132804/Open-folders-using-a-Run-Command

                  到目前为止,我已经尝试过 Process Monitor 并搜索注册表,但我似乎无法在 regedit 中找到我的 Windows Explorer 收藏夹.

                  So far I've tried Process Monitor and searching the registry, but I can't seem to find my Windows Explorer Favourites in regedit.

                  <小时>Microsoft 在 Windows 8 中对此进行了更改,因此我相应地标记了我的问题.请参阅 Win8 & 的标记答案中的评论等细节.


                  Microsoft has changed this in Windows 8 so I have tagged my question accordingly. Please see the comments in the marked answer for Win8 & etc details.

                  推荐答案

                  PS:请务必查看 @bsegraves' 解决方案,我认为这是比我的好多了.

                  P.S.: Make sure to check out @bsegraves' solution, which I think is far better than mine.

                  我不确定这是否是您要查找的内容,但我认为可以通过以下注册表值找到最喜欢的文件夹:

                  I'm not sure if this is what you're looking for, but I think the favorite folder can be found through the following registry value:

                  HKEY_CURRENT_USER
                    Software
                      Microsoft
                        Windows
                          CurrentVersion
                            Explorer
                              User Shell Folders
                                Favorites
                  

                  您应该能够使用以下代码检索此文件夹名称:

                  You should be able to retrieve this folder name with the following code:

                  using Microsoft.Win32;
                  ...
                  
                  RegistryKey topLevel = Registry.CurrentUser;
                  RegistryKey key = topLevel.OpenSubKey(
                      @"SoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders",
                      true);
                  
                  string favoriteFolder = key.GetValue("Favorites").ToString();
                  

                  然后只需在指定文件夹中创建链接或文档即可.

                  It's then only a matter of creating a link, or document, in the specified folder.

                  (请注意,此键的值可能类似于 %USERPROFILE%Favorites;环境变量应由 .GetValue(..) 方法自动扩展上面调用过.)

                  (Take note that this key's value might be something like %USERPROFILE%Favorites; the environment variable should automatically get expanded by the .GetValue(..) method invoked above.)

                  这篇关于如何以编程方式将文件夹添加到用户的收藏夹(在 Windows 资源管理器中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:有没有办法以编程方式判断系统是否启用了触摸? 下一篇:.NET 4.0 &amp; 上的性能计数器Windows 7的

                  相关文章

                  <legend id='ctH7a'><style id='ctH7a'><dir id='ctH7a'><q id='ctH7a'></q></dir></style></legend>
                • <tfoot id='ctH7a'></tfoot>
                  <i id='ctH7a'><tr id='ctH7a'><dt id='ctH7a'><q id='ctH7a'><span id='ctH7a'><b id='ctH7a'><form id='ctH7a'><ins id='ctH7a'></ins><ul id='ctH7a'></ul><sub id='ctH7a'></sub></form><legend id='ctH7a'></legend><bdo id='ctH7a'><pre id='ctH7a'><center id='ctH7a'></center></pre></bdo></b><th id='ctH7a'></th></span></q></dt></tr></i><div id='ctH7a'><tfoot id='ctH7a'></tfoot><dl id='ctH7a'><fieldset id='ctH7a'></fieldset></dl></div>

                  1. <small id='ctH7a'></small><noframes id='ctH7a'>

                      • <bdo id='ctH7a'></bdo><ul id='ctH7a'></ul>