I am building a windows forms application using C# that needs to get launched when a user clicks on a file with custom extension(eg. filename.mycustomextension)
I plan to put a url in the filename.mycustomextension file. when user clicks on this file, we winform application should launch and also read contents of this file.
Is it possible to do this?
I am building a windows forms application using C# that needs to get launched
Share
First and most obviously you’ll need to associate the file extension with the application either by “open with” in the shell, through an installer or directly in the registry.
MSDN – Best Practices for File Associations
Then from there it’s really pretty simple.
Offhand I can’t find any examples that show all of this together simply but Scott Hanselman has a nice example of loading files through a single instance WinForms application, about the same…
http://www.hanselman.com/blog/CommentView.aspx?guid=d2f676ea-025b-4fd6-ae79-80b04a34f24c