Search code examples
c#hyperlinkcode-behind

How to connect hyperlink with our program


I have problem, i don't know how to connect hyperlink with my program. I want add to registry key until install which connect file extension with my program.

e.g. I have hyperlink on website which open file .xyz, and i wannna browser "open file as [my_program_in_c#]".


Solution

  • You need to create the following registry keys, perhaps during installation

    [HKEY_CLASSES_ROOT.xyz] @="dawid.xyz.1.0"

    [HKEY_CLASSES_ROOT.xyz\OpenWithProgids] "dawid.xyz.1.0"=""

    [HKEY_CLASSES_ROOT\dawid.xyz.1.0] @="Description of the extension"

    [HKEY_CLASSES_ROOT\dawid.xyz.1.0\DefaultIcon] @="valid location of icon"

    [HKEY_CLASSES_ROOT\atmelstudio.objproj.6.1\shell\open\command] @="[my_program_in_c#"

    or manually using this