Associate .txt files with VB.NET Program

2019-09-08 04:38发布

I created a super basic text editor which can read .txt files. I would like to know how I can set my basic text editor to the default .txt file extension so whenever the user clicks on a .txt file, at first it will show the "default program" window. If the user clicks on my program then the text files will be always opened using my program. How can this be done?

1条回答
戒情不戒烟
2楼-- · 2019-09-08 05:42

It depends on your version of windows, but in Windows 7/Vista you can click Start->Default programs

http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7

In Windows XP it's a little more difficult:

  1. Go to the Start menu and select All Programs.
  2. Select Set Program Access and Defaults.
  3. To select an option, click on the radio button beside it.
  4. If you need to expand the option, click on the double arrows for that option on the right side of the window.

http://support.microsoft.com/kb/332003

If you want to do this programatically, you have to edit some registry settings. See here: http://msdn.microsoft.com/en-us/library/windows/desktop/cc144154%28v=vs.85%29.aspx

查看更多
登录 后发表回答