customize the template of new files in vs.net 2003

In VS.net 2003, when we add a new item, i.e. a class, a webpage, or a form, to the project, the IDE will automatically generate some code in the newly-created files. This can surely save us some time writing repeated code. But sometimes we may want to customize the auto-generated code, for instance to add the copyright info in the header of the files. Although undocumented, there is a way to customize the templates from which vs.net 2003 created new files.
First let's take a look into the vs.net 2003 installation folder, as illustrated in the following figure:

VS.Net 2003 installation folder

We'll examine VC# folder only here, other folders (such as Vb7 and Vc7) are simlimar in structure. As can be seen, there is a “VC#Wizards” folder under “VC#”. This folder stores all the templates from which all the new files are created. Folder “VC#Wizards/1033” is the deposit for shared files common to all the templates, such as javascript, cascade style sheet, and images. “1033” stands for “US-English” culture. This number should vary according to your vs.net 2003 installation language. Except this shared folder, each folder under “VC#Wizards” represents one kind of template and has a “Templates/1033” subfolder in it. Again, “1033” have the same meaning with that under “VC#Wizards”.
For example, if we create a asp.net web application, the template for web form resides in “VC#Wizards/CShareWebAppWiz/Templates/1033”and is named "WebForm1.aspx", as shown in the following figure:

Template for Asp.Net Web application

Now we can customize the content of this file as we need. We can also make modification to other templates in the same way.

Please Note: The templates specified in this article have effect to all the users sharing the same computer and developing using vs.net 2003, so make sure your modification is what is really needed by everyone. Besides, vs.net 2003 is fully customizable, if you like, you can also choose to use vb macros to add some content to your code, which is especially useful for adding some universal comments (such as copyright info) whenever a new file is created.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值