VS中如何自定义新建文件模板
来源:互联网 发布:工程造价定额查询软件 编辑:程序博客网 时间:2024/05/29 19:39
VS中如何自定义新建文件模板(添加自定义版权信息)
只要将X:/Program Files/Microsoft Visual Studio 8/Common7/IDE/ItemTemplates中相应的文档模板Copy到X:/My Documents/Visual Studio 2005/Templates然后修改成你需要的样式.就可以在VS中新建文件的时候,可以在MyTemplates里面看到自定义的文件模板.
还可以直接修改 X:/Program files/Microsoft Visual Studio 8/Common7/IDE/ItemTemplatesCache里面的模板甚至是X:/Program Files/Microsoft Visual Studio 8/Common7/IDE/ItemTemplates里面的模板也能达到效果.只是这样这两种方法都有不好的地方.修改ItemTemplatesCache只是修改临时缓存模板,如果执行devenv /setup 重新配置VS就会丢失自定义的设置,如果修改ItemTemplates,就会永久更改原来的模板,无法恢复了.
下边是从msdn copy的一些可以在模板里面用的变量,例如插入$time$就会显示当前时间.具体请看:
clrversion
Current version of the common language runtime (CLR).
GUID [1-10]
A GUID used to replace the project GUID in a project file. You can specify up to 10 unique GUIDs (for example, guid1).
itemname
The name provided by the user in the Add New Item dialog box.
machinename
The current computer name (for example, Computer01).
projectname
The name provided by the user in the New Project dialog box.
registeredorganization
The registry key value from HKLM/Software/Microsoft/Windows NT/CurrentVersion/RegisteredOrganization.
rootnamespace
The root namespace of the current project. This parameter is used to replace the namespace in an item being added to a project.
safeitemname
The name provided by the user in the Add New Item dialog box, with all unsafe characters and spaces removed.
safeprojectname
The name provided by the user in the New Project dialog box, with all unsafe characters and spaces removed.
time
The current time in the format DD/MM/YYYY 00:00:00.
userdomain
The current user domain.
username
The current user name.
year
The current year in the format YYYY.
另外还可以用VS的模板导出功能,这个方法更正式,只是我没有用过.
- VS中如何自定义新建文件模板
- vs中自定义模板
- VS如何自定义类模板
- VS中自定义模板方法
- VS 中自定义模板 1
- VS中自定义注释模板
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- VS2008中自定义C++工程模板与修改新建文件默认编码的办法
- 使用CLI连接到DB2数据库
- android 固件升级/复位实现方法分析
- Shlwapi介绍(转)
- perl 是用 eval 实现异常处理
- 关于ASP.net中时间比较的方法 DateTime.Compare()
- VS中如何自定义新建文件模板
- wxpython笔记
- c++中关于内存的一些问题
- Android-SQLite3 超基础入门
- 截桌面屏幕
- 通过IE句柄 获得 IE Document对象和IWebBrowser2对象
- 多线程操作界面控件的解决方案
- 学习经验摘抄
- 感想