问题
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
回答1:
If you have a Deployment project for your program it is easy to do with the File Types Editor:
- Select your deployment project
- Click on the File Types Editor button
- Right click on the "File Types on Target Machine"
- Add File Type
- Use the Extensions property on your new File Type to specify one or more file extensions to be associated with your program.
- In the Command property choose "Primary output" from your application.
回答2:
You can not. You can associate your program with a specific file extension, but you can not FORCE the user to use your program to open a file. Even registration entries are easy to change (open with in the context menu).
回答3:
You need to associate extension with your program: Registering the Extension
来源:https://stackoverflow.com/questions/4067545/how-to-force-that-any-file-of-a-certain-type-will-open-with-my-program