jcvegan
jcvegan

Reputation: 3170

c# program how to open file with double click

I have a C# program which works with files created by itself. The file can be opened by running the program and then accessing it via the GUI.

How can I open the file without having to run the program explicitly and just by double clicking on the concerned file?

Upvotes: 0

Views: 3361

Answers (3)

JohnFx
JohnFx

Reputation: 34907

You have to add registry entries in your installer to associate your program's file extension with your application.

Here is an article in MSDN that will tell you what you need to know about file associations: How File Associations Work

Upvotes: 1

Mike Atlas
Mike Atlas

Reputation: 8231

You're asking how to associate a file type with your application. You can do this by adding entries to the registry using C#.

Upvotes: 0

Ragoczy
Ragoczy

Reputation: 2937

Typically you'd do this with your install, if you're not using an installer or ClickOnce, then you can do it from code, but you have to muck about in the registry: http://mel-green.com/2009/04/c-set-file-type-association/

Upvotes: 1

Related Questions