Click here to Skip to main content
15,937,198 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Usually when a program in installed, you can click on a file of that type and the file will open in the program.

For example, in Excel, you click on an .xls file, and Excel boots up and opens the program.

I know the file association (e.g. .xls is Excel) would be done by an installer.

In C#, how does the file get opened and displayed? I presume there is a method that is called in such situations?

1 solution

You have to associate the file extension with the application. You can do this in your setup project. Google is your friend.

Word of caution - you should probably try to ensure that your file extension is unique. You will have more luck with this if you use more than three letters for the extension. For example, instead of ".txt", use ".txt123".
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900