在添加页面时候让文件自动添加版权信息
找到VS2008安装目录:

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

view plaincopy to clipboardprint?
//======================================================================  
//  
//        Copyright (C) 2008-2009 CUIT-408. All rights reserved.  
//  
//        CLR Version: $clrversion$  
//        NameSpace: $rootnamespace$  
//        FileName: $safeitemname$  
//  
//        Created by Benjamin at $time$  
//        http://blog.csdn.com/TBenjamin  
//  
//======================================================================  
 
 
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
$if$ ($targetframeworkversion$ == 3.5)using System.Linq;  
$endif$using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
$if$ ($targetframeworkversion$ == 3.5)using System.Xml.Linq;  
$endif$  
namespace $rootnamespace$  
{  
    public partial class $classname$ : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
    }  

//======================================================================
//
//        Copyright (C) 2008-2009 CUIT-408. All rights reserved.
//
//        CLR Version: $clrversion$
//        NameSpace: $rootnamespace$
//        FileName: $safeitemname$
//
//        Created by Benjamin at $time$
//        http://blog.csdn.com/TBenjamin
//
//======================================================================


using System;
using System.Collections;
using System.Configuration;
using System.Data;
$if$ ($targetframeworkversion$ == 3.5)using System.Linq;
$endif$using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
$if$ ($targetframeworkversion$ == 3.5)using System.Xml.Linq;
$endif$
namespace $rootnamespace$
{
    public partial class $classname$ : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
 


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

view plaincopy to clipboardprint?
//======================================================================  
//  
//        Copyright (C) 2008-2009 CUIT-408. All rights reserved.  
//  
//        CLR Version: 2.0.50727.1433  
//        NameSpace: WebApplication8  
//        FileName: WebForm4  
//  
//        Created by Benjamin at 2009-9-6 15:29:05  
//        http://blog.csdn.net/TBenjamin  
//  
//====================================================================== 
//======================================================================
//
//        Copyright (C) 2008-2009 CUIT-408. All rights reserved.
//
//        CLR Version: 2.0.50727.1433
//        NameSpace: WebApplication8
//        FileName: WebForm4
//
//        Created by Benjamin at 2009-9-6 15:29:05
//        http://blog.csdn.net/TBenjamin
//
//======================================================================

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

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/TBenjamin/archive/2009/09/11/4542777.aspx

 posted on 2010-05-19 18:02  dongpo  阅读(586)  评论(0编辑  收藏  举报