[英]Is it possible to open Windows Explorer from a linklabel
大家早上好,
我有一個將作為Excel加載項分發的項目,它是用C#編寫的,並使用ExcelDNA。
我想做的是在我的加載項主窗體中添加一個鏈接標簽,單擊該鏈接時,我希望以特定的索引(例如G:驅動器)打開Windows資源管理器。
這可能嗎? 我看過一些例子,但還沒弄清楚它們,
提前致謝!
絕對:
從Microsoft KB :
Option Function
----------------------------------------------------------------------
/n Opens a new single-pane window for the default
selection. This is usually the root of the drive that
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 program selected.
Examples
-----------------------------------------------------------------------
Example 1: Explorer /select,C:\TestDir\TestProg.exe
Opens a window view with TestProg selected.
Example 2: Explorer /e,/root,C:\TestDir\TestProg.exe
Opens Explorer with drive C expanded and TestProg selected.
Example 3: Explorer /root,\\TestSvr\TestShare
Opens a window view of the specified share.
Example 4: Explorer /root,\\TestSvr\TestShare,select,TestProg.exe
Opens a window view of the specified share with TestProg selected.
因此,您可以調用Explorer /select,G:\\yourfile
來打開Explorer /select,G:\\yourfile
該文件/目錄。
將該調用放入Process.Start()
等:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.