VS2008 修改模板,让项目文件自动添加版权信息

找到VS2008安装目录:

[盘符]:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/ItemTemplatesCache/CSharp/Web/2052
可以根据需要对此文件夹下对应模板进行修改.
我需要该的是Web项目 所以吧WebForm.zip下面的Default.aspx.cs
插入版权信息,代码如下

view plain
  1. //======================================================================  
  2. //  
  3. //        Copyright (C) 2008-2009 CUIT-408. All rights reserved.  
  4. //  
  5. //        CLR Version: $clrversion$  
  6. //        NameSpace: $rootnamespace$  
  7. //        FileName: $safeitemname$  
  8. //  
  9. //        Created by Benjamin at $time$  
  10. //        http://blog.csdn.com/TBenjamin  
  11. //  
  12. //======================================================================  
  13.   
  14.   
  15. using System;  
  16. using System.Collections;  
  17. using System.Configuration;  
  18. using System.Data;  
  19. $if$ ($targetframeworkversion$ == 3.5)using System.Linq;  
  20. $endif$using System.Web;  
  21. using System.Web.Security;  
  22. using System.Web.UI;  
  23. using System.Web.UI.HtmlControls;  
  24. using System.Web.UI.WebControls;  
  25. using System.Web.UI.WebControls.WebParts;  
  26. $if$ ($targetframeworkversion$ == 3.5)using System.Xml.Linq;  
  27. $endif$  
  28. namespace $rootnamespace$  
  29. {  
  30.     public partial class $classname$ : System.Web.UI.Page  
  31.     {  
  32.         protected void Page_Load(object sender, EventArgs e)  
  33.         {  
  34.   
  35.         }  
  36.     }  
  37. }  


完成后保存.以后在Web项目添加新页面时候,页面后台代码最前端都会出现一下添加的版权信息,呵呵

view plain
  1. //======================================================================  
  2. //  
  3. //        Copyright (C) 2008-2009 CUIT-408. All rights reserved.  
  4. //  
  5. //        CLR Version: 2.0.50727.1433  
  6. //        NameSpace: WebApplication8  
  7. //        FileName: WebForm4  
  8. //  
  9. //        Created by Benjamin at 2009-9-6 15:29:05  
  10. //        http://blog.csdn.net/TBenjamin  
  11. //  
  12. //======================================================================  

其他的文件也是类似的....


转帖:http://blog.csdn.net/TBenjamin/article/details/4542777

你可能感兴趣的:(c,Web,webform)