我有一个c#应用程序,可以下载文件,并且无论扩展名是否为已知扩展名,都应始终显示打开方式"对话框.
I have a c# application, which downloads a file, and should always show the Open With dialog, regardless if the extension is a known extension or not.
我尝试了
global::System.Diagnostics.Process.Start("rundll32.exe", string.Format("shell32.dll,OpenAs_RunDLL \"{0}\"", filename));但是,当我尝试打开.png文件时,打开方式"对话框不显示,并且使用默认的图像查看器打开了文件.
but, when I try to open a .png file, the "Open With" dialog does not show and the file gets opened with my default image viewer.
用户应该能够选择一个应用程序(例如,也许他想编辑文件而不是查看文件).有没有一种方法可以强制Vista显示打开方式对话框,以便用户可以选择?
The user should be able to choose an application (eg. maybe he wants to edit the file instead of viewing it). Is there a way to force Vista to show the open with dialog, so the user can choose ?
推荐答案我相信您正在寻找这篇文章:
This article is what you're looking for, I believe:
使用C#从应用程序中调用打开方式"对话框
该代码也应在Vista中工作.
The code should work in Vista too.
更多推荐
c#打开文件始终显示“打开方式";对话
发布评论