我怎样才能让一个应用程序打开时,在其相关文件中的用户双击? [英] How can I make an application open when a user double clicks on its associated file?
问题描述
我创建一个使用特定的文件格式作为数据源的应用程序。我想这个应用程序,只要打开该文件的用户双击,如MS Word将如何打开时Word文档,用户双击。我如何做到这一点?此外,我怎么会填充使用用户选择的文件中的数据字段。我会使用args来[]从Program.cs文件类?我使用C#编写这个应用程序。
I am creating an application that uses a certain file format as its data source. I want this application to open whenever the user double clicks on this file, like how MS Word will open when a user double clicks on a Word document. How do I accomplish this? Also how would I populate the data fields using the file that the user selected. Would I use args[] from the program.cs class? I am using c# to code this application.
N.B。我希望在主机上安装应用程序而无需用户做任何事情来进行此关联。
N.B. I want this association to be made when the application is installed on the host machine without the user doing anything.
推荐答案
我设法解决这个问题。我用WIX创建一个安装文件,并要求它与当它安装应用程序的文件关联。
I managed to solve this issue. I used WIX to create an install file and asked it to associate the file with the application when it installs.
这篇关于我怎样才能让一个应用程序打开时,在其相关文件中的用户双击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!