在*.cs或*.vb文件中加入版本跟踪信息
来源:岁月联盟
时间:2005-08-01
注:如果是vb.net程序则可添入*.vb,依此类推!也可以输入多种文件类型,如*.txt, *.c, *.vb,*.cs,*.vb以逗号隔开即可。其次:运行Microsoft Visual SourceSafe 6.0,进入主界面,选择Tools菜单,点击Options进入选项设置页面,进入Local Files选项页,选中Copy keyword-expanded files into working folder选项,完成后点击[确定],保存选项。下面就可以在.net的项目中加入版本跟踪信息了。
在每一个.CS文件的最开头加入如下代码:
/*$Header$
$Author$
$Date$
$Revision$$History$*/
这样,每次更改后签入或签出就会自动出现版本信息(请不要手动去更改):
/*$Header: /TestVSS/TestVSS/TestVSS/Class1.cs 9 05-07-26 13:50 Edward.Net $
$Author: Edward.Net $
$Date: 05-07-26 13:50 $
$Revision: 9 $$History: Class1.cs $
*
* ***************** Version 9 *****************
* User: Edward.Net Date: 05-07-26 Time: 13:50
* Updated in $/TestVSS/TestVSS/TestVSS
*/
其他资源(来自y97523szb的如何在*.CS文件中加入版本跟踪信息?):
Type this keyword
To add the following
$Archive: $
VSS archive file location
$Author: $
User who last changed the file
$Date: $
Date and time of last check in
$Header: $
Logfile, Revision, Date, Author
$History: $
File history, VSS format
$JustDate: $
Date, without the time addendum.
$Log: $
File history, RCS format
$Logfile: $
Same as Archive
$Modtime: $
Date and time of last modification
$Revision: $
VSS version number
$Workfile: $
File name
$NoKeywords: $
No keyword expansion for all keywords that follow
另外关于[如何在*.cs文件中加入版本跟踪信息?]一文中提到的必须使用vss6.0d版本,经过本人测试vss6.0c也同样支持以上功能。