How to associate a file extension to the current executable in C#

后端 未结 9 2223
故里飘歌
故里飘歌 2020-11-22 12:01

I\'d like to to associate a file extension to the current executable in C#. This way when the user clicks on the file afterwards in explorer, it\'ll run my executable with t

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 12:46

    The file associations are defined in the registry under HKEY_CLASSES_ROOT.

    There's a VB.NET example here that I'm you can port easily to C#.

提交回复
热议问题