C#winform打开进程所在的文件夹,如何使进程所对应的文件被选中?
我自己的方法打开选定的进程的文件位置,效果如图:
系统的任务管理器,打开同一进程文件位置,效果如下:
请问,怎样才能实现像系统的任务管理器一样的功能,打开文件位置的文件夹后自动选定对应的文件呢?
希望能给出实例代码,我会自行研究,谢谢!
------解决方案--------------------Explorer [/n] [/e] [(,)/root,<object>] [/select,<object>]
/n Opens a new single-pane window for the default
selection. This is usually the root of the drive Windows
is installed on. If the window is already open, a
duplicate opens.
/e Opens Windows Explorer in its default view.
/root,<object> Opens a window view of the specified object.
/select,<object> Opens a window view with the specified folder, file or
application selected.------解决方案--------------------最后那句改成
Process.Start("explorer.exe","/select," + str)