<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 资源管理器中)?

        How do I programmatically add a folder to the user#39;s Favorites (in Windows Explorer)?(如何以编程方式将文件夹添加到用户的收藏夹(在 Windows 资源管理器中)?)
        <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 资源管理器中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)
                    <tbody id='ctH7a'></tbody>
                    <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>