<bdo id='FArkh'></bdo><ul id='FArkh'></ul>

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

      1. <tfoot id='FArkh'></tfoot>

        <legend id='FArkh'><style id='FArkh'><dir id='FArkh'><q id='FArkh'></q></dir></style></legend>
        <i id='FArkh'><tr id='FArkh'><dt id='FArkh'><q id='FArkh'><span id='FArkh'><b id='FArkh'><form id='FArkh'><ins id='FArkh'></ins><ul id='FArkh'></ul><sub id='FArkh'></sub></form><legend id='FArkh'></legend><bdo id='FArkh'><pre id='FArkh'><center id='FArkh'></center></pre></bdo></b><th id='FArkh'></th></span></q></dt></tr></i><div id='FArkh'><tfoot id='FArkh'></tfoot><dl id='FArkh'><fieldset id='FArkh'></fieldset></dl></div>
      2. 在 Windows 资源管理器上获取拖放文件的文件路径

        时间:2023-08-25
        <i id='1tsQS'><tr id='1tsQS'><dt id='1tsQS'><q id='1tsQS'><span id='1tsQS'><b id='1tsQS'><form id='1tsQS'><ins id='1tsQS'></ins><ul id='1tsQS'></ul><sub id='1tsQS'></sub></form><legend id='1tsQS'></legend><bdo id='1tsQS'><pre id='1tsQS'><center id='1tsQS'></center></pre></bdo></b><th id='1tsQS'></th></span></q></dt></tr></i><div id='1tsQS'><tfoot id='1tsQS'></tfoot><dl id='1tsQS'><fieldset id='1tsQS'></fieldset></dl></div>

        <small id='1tsQS'></small><noframes id='1tsQS'>

        • <bdo id='1tsQS'></bdo><ul id='1tsQS'></ul>
              1. <tfoot id='1tsQS'></tfoot>
                  <tbody id='1tsQS'></tbody>
                  <legend id='1tsQS'><style id='1tsQS'><dir id='1tsQS'><q id='1tsQS'></q></dir></style></legend>
                  本文介绍了在 Windows 资源管理器上获取拖放文件的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  drag-n-drop 是很多网站(这也是)中讨论得很好的话题,我也发现了很好的问题,但没有答案.

                  drag-n-drop is a pretty discussed topic in a lot sites (this too) and i found nice questions too, but no answer to this case.

                  我有一个包含一些元素的 listView,我需要将它们放在 Windows Explorer 上.删除时,我只需要删除文件的路径,我不需要复制任何内容,只需要路径.

                  I have a listView with some elements and i need them to be droppable on the Windows Explorer. When dropped i need only the file path where those are dropped, i don't need to copy anything, just need the path.

                  类似的问题(以及为什么它们不适合我):

                  Similar question (and why they don't work for me):

                  • 拖放到桌面/资源管理器(仅当您已经有要复制的文件并且没有给出路径)
                  • http://blogs.msdn.com/b/delay/archive/2009/11/16/creating-something-from-nothing-and-knowing-it-developer-friendly-virtual-file-implementation-for-net-refined.aspx (这看起来不错,但它仍然创建一个虚拟文件并将其复制到该位置,所以我没有路径和仍然需要在我的目的地复制一些东西)
                  • Drag and drop to Desktop / Explorer (this works only if you already have the file to copy and doesn't give path)
                  • http://blogs.msdn.com/b/delay/archive/2009/11/16/creating-something-from-nothing-and-knowing-it-developer-friendly-virtual-file-implementation-for-net-refined.aspx (this looks good but it still create a virtual file and copy it to the location, so i have no path and still have to copy something in my destination)

                  我找到的唯一解决方案:

                  The only solution i found:

                  http://www.codeproject.com/Articles/23207/Drag-and-Drop-to-Windows-Folder-C

                  这可行,但以一种非常不切实际"的方式,它创建一个文件观察器,创建一个虚拟文件,让 DragDrop 函数复制它,观察它的创建位置,最后删除它.在我的 Windows8.1 中测试它会导致资源管理器刷新不正确,在我刷新屏幕 (F5) 之前我仍然可以看到该文件.

                  This works but in a very "unpratical" way, it creates a file watcher, create a dummy file, let the DragDrop function copy it, watch where it was created and finally delete it. Testing it in my Windows8.1 results in a incorrect Explorer refresh and i can still see the file until i refresh my screen (F5).

                  这是唯一的方法吗?我仍然无法相信我无法以更简单的方式实现这一目标

                  Is this the only way? I still can't believe i can't achieve this in a simpler way

                  推荐答案

                  想一想...如果你知道拖放,那么你就会知道拖动源担心将数据打包成正确的格式和拖动目标担心以正确的格式检索数据.您的问题是您的拖动目标不在您的 WPF 应用程序中,因此在删除数据时您可以做的事情很少.

                  Think about it for a minute... if you know about drag and drop, then you'll know that the drag source worries about packaging up the data into the correct format and the drag target worries about retrieving the data in the correct format. Your problem is that your drag target is not in your WPF application and so there is very little that you can do as the data is dropped.

                  更好的解决方案是实现自己的基本文件浏览器,然后作为应用程序的一部分,通过拖放操作访问文件路径会简单得多.无论哪种方式,你都有很多工作要做.

                  A much better solution would be to implement your own basic file browser and then as part of your application, it would be far simpler to access the file path with the drag and drop operation. Either way, you've got a lot of work to do.

                  这篇关于在 Windows 资源管理器上获取拖放文件的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 VirtualFileDataObject 使用 IStream 拖放大型虚拟文 下一篇:如何拖动&amp;将项目放在同一个 ListView 中?

                  相关文章

                  最新文章

                • <small id='9XbKo'></small><noframes id='9XbKo'>

                • <legend id='9XbKo'><style id='9XbKo'><dir id='9XbKo'><q id='9XbKo'></q></dir></style></legend>

                    <bdo id='9XbKo'></bdo><ul id='9XbKo'></ul>

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