C# Setting my application as default app

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 03:25:51

问题


I'm a novice programmer and have developed a notepad replacement application for my own needs (with some more features). When I double click a .txt file (or a customizable extension such as .abc), I want the file to run in my application just like notepad. I read about File Association with programs but I didn't get much of it.

Can someone point me to how I would do this? Just give me a few ideas, I would really like to do this and have an option for my users to set the application as the default text editor. Help would be much appreciated.


回答1:


If you are using click-once deployment (i.e. "publish" in VS for a windows exe), you can specify file associations there, and it will do everything for you. I can't guarantee that it'll take precedence over notepad, though. For that you might need a proper installer...

MSDN shows how




回答2:


Have a look here: how to force that any file of a certain type will open with my program?



来源:https://stackoverflow.com/questions/4077352/c-sharp-setting-my-application-as-default-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!