Search code examples
c#winformsfile-format

how to force that any file of a certain type will open with my program?


i have build program that can open *.sdf files and show all the table & the data.

how to force that any *.sdf file in my computer will open with my program ?

thank's in advance


Solution

  • If you have a Deployment project for your program it is easy to do with the File Types Editor:

    1. Select your deployment project
    2. Click on the File Types Editor button
    3. Right click on the "File Types on Target Machine"
    4. Add File Type
    5. Use the Extensions property on your new File Type to specify one or more file extensions to be associated with your program.
    6. In the Command property choose "Primary output" from your application.