简体   繁体   English

如何在C#的Windows资源管理器窗口中获取所选文件?

[英]How to get selected file in Windows Explorer window in C#?

I want to get the selected file or folder in the active explorer window and then pass it's path to my program,how do I do it? 我想在活动的资源管理器窗口中获取选定的文件或文件夹,然后将其路径传递给我的程序,该怎么办? for example I click on x.exe on windows explorer and then press CTRL+SHIFT+X hotkey and do something.I need my program to get this path. 例如,我在Windows资源管理器上单击x.exe,然后按CTRL + SHIFT + X热键并执行某些操作。我需要我的程序才能获取此路径。 I found a C++ solution but I can't figure out a C# solution for this.also I'm building a wpf application. 我找到了C ++解决方案,但无法为此找到C#解决方案。而且我还在构建wpf应用程序。

see here: https://stackoverflow.com/questions/7222749 看到这里: https : //stackoverflow.com/questions/7222749

there is already the C# code to find the desktop. 已经有用于查找桌面的C#代码。 This does not solve your exact issue but you can copy a lot of code and see how it works to detect the double click on the desktop :) 这不能解决您的确切问题,但是您可以复制很多代码,并查看它如何工作以检测桌面上的双击:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#:如何使用选定的许多文件打开Windows资源管理器窗口 - C#: How to open Windows Explorer windows with a number of files selected 如何从 C# 中获取 Windows 资源管理器的选定文件? - How to get Windows Explorer's selected files from within C#? 如何在 C# 中关闭特定的 Windows 资源管理器窗口? - How to close a particular windows explorer window in c#? c#从上下文菜单Windows资源管理器中的选定文件/文件夹中检索文件/文件夹路径 - c# retrieve file/folder path from selected file/folder in Context Menu Windows Explorer C#使用Windows File Explorer将所选文件设置为字符串数组? - C# using Windows File Explorer to set selected file to string array? 使用c#获取每个资源管理器窗口的路径 - Get the path of every explorer window with c# 通过上下文菜单获取从选定的Windows资源管理器文件夹到C#的路径 - Get the path from an selected windows explorer folder to C# via context menu 如何在C#中连接资源管理器属性窗口 - How to internet explorer properties window in C# 如何在C#中使用任务栏启动Windows资源管理器 - How to start windows explorer with taskbar in c# 使用JNA在Windows资源管理器中获取选定的文件项 - Get selected file item in Windows Explorer using JNA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM