Your scenario makes me think that it's perfectly possible for you to simply select any JPG file, right click on the file, select "Open with" --> Choose default program, browse to your C# program and select the option "Always use the selected program to open this kind of file"
If you feel that you need to do this programmatically, you would need to set this on the Registry.
Here's a SO link that shows the process.