C# 是否可以从链接标签打开Windows资源管理器
大家早上好 我有一个项目将作为Excel外接程序分发,它是用C#编写的,并使用ExcelDNA 我想做的是在我的外接程序主窗体中添加一个链接标签,单击后,我想在特定索引处打开windows资源管理器,例如:驱动器 这可能吗?我看过一些例子,但没能把它们解释清楚 提前谢谢 绝对: 从:C# 是否可以从链接标签打开Windows资源管理器,c#,excel,excel-dna,C#,Excel,Excel Dna,大家早上好 我有一个项目将作为Excel外接程序分发,它是用C#编写的,并使用ExcelDNA 我想做的是在我的外接程序主窗体中添加一个链接标签,单击后,我想在特定索引处打开windows资源管理器,例如:驱动器 这可能吗?我看过一些例子,但没能把它们解释清楚 提前谢谢 绝对: 从: 选项功能 ---------------------------------------------------------------------- /n为默认设置打开一个新的单窗格窗口 选择。这通常是驱动
选项功能
----------------------------------------------------------------------
/n为默认设置打开一个新的单窗格窗口
选择。这通常是驱动程序的根目录
Windows安装在上。如果窗口已经打开
打开,将打开一个副本。
/e在其默认视图中打开Windows资源管理器。
/根,打开指定对象的窗口视图。
/选择,打开具有指定文件夹、文件、,
或选定的程序。
例子
-----------------------------------------------------------------------
示例1:Explorer/select,C:\TestDir\TestProg.exe
打开选中TestProg的窗口视图。
示例2:Explorer/e,/root,C:\TestDir\TestProg.exe
打开资源管理器,扩展驱动器C并选择TestProg。
示例3:Explorer/root,\\TestSvr\TestShare
打开指定共享的窗口视图。
示例4:Explorer/root,\\TestSvr\TestShare,select,TestProg.exe
打开选定TestProg的指定共享的窗口视图。
因此,您可以调用Explorer/select,G:\yourfile
,在选中该文件/目录的情况下打开浏览器
把那个电话打进去,瞧:)
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.