前言
在vs编写代码的时候,需要向新建的类中添加自己的版权信息等。每次总是复制粘贴这些信息,不仅仅麻
烦,按照编程的思想来说也是非常不合理的。还记得在大话设计模式中大鸟说过:“复制粘贴是最容易的
编程,也是最没有价值的编程”。下面就与大家分享一下如何自定义添加版权信息等。
正文
1.找到vs2010类的文件
D:Program FilesMicrosoft Visual Studio10.0Common7IDEItemTemplatesCSharpCode2052
在你的vs安装文件下可以找到,下面有这样一些文件。
2.添加信息并更新
找到class.zip,将你的版权信息添加进去、保存、并更新就可以了。建议使用7-zip软件打开。用WinRAR打
开的时候总会出现这样的问题,
但是用7-zip就不会这样问题,可以直接更新。其他的模版同理可得。
3.问题
在我更改后,版权信息出现了,但是在设置时间变量里面的时间没有变化。
这时候还需要将
D:Program FilesMicrosoft Visual Studio10.0Common7IDEItemTemplatesCacheCsharpCode2052,注意是ItemTemplatesCache,从
字面上理解为模版的缓存,具体也不太清楚是什么意思。也将这里的类模版更改,这时候就perfect了。如
图完美了。