如何在C#中获取与文件扩展名相关的推荐程序
我想获取与文件扩展名相关的程序的路径,最好是通过 Win32 API。
- “打开方式”菜单中显示的程序列表 item
- 按照推荐出现的程序列表 “打开方式...”对话框。
UPD:
假设我的机器上安装了office11和office12,.xls的默认程序是office 11。如果查看HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open\command,有一个到office11 excel.exe的路径,但是当我右键单击文件时,我可以在打开方式菜单项中选择office12。那么这个关联存储在哪里呢?
我正在使用 C#。
谢谢。
I want to get path to the programs that associated with file extension, preferably through Win32 API.
- List of programs that appears in "Open With" menu
item - List of programs that appears as recommended in
"Open With..." dialog.
UPD:
Assume that i have office11 and office12 installed on my machine, default program for .xls is office 11. If look at HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open\command there is a path to office11 excel.exe, but when i right click on file i can choose office12 in Open With menu item. So where is this association stored?
I'm using C#.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我写了一个小例程:
它被这样调用:
I wrote a small routine:
which gets called like so:
系统文件关联
System File Association
我通过LarsTech改进了方法。现在它返回程序的路径。
I improved method by LarsTech. Now it returns paths to programs.