1.VisualStudio2017设置版权
在团队开发或者公司开发中,我们一般都喜欢给自己所创建的类或者接口以及其它模板设置版权说明,但是每个类一个一个的去加又是非常的费劲,所以一般情况下我们都是设置模板来实现它,当您在VS中创建类或者接口等的时候自动将这些注释添加到您所在的类或者接口中。
我简单总结了一下给VS2017添加版权的说明
1.首先找到你的安装路径,如果你忘记了你所在的安装路径,不要紧,可以使用如下地址找到:找到VS图标,右键属性:弹出如图所示:
![](https://images2018.cnblogs.com/blog/1276252/201805/1276252-20180508142937317-1981434770.png)
找到如图红线所画的地址,复制,去掉最后devenv.exe和双引号,将路径拷贝之后打开我的电脑拷贝到路径地址,打开如图所示:
![](https://images2018.cnblogs.com/blog/1276252/201805/1276252-20180508143159064-76640433.png)
3.继续往下查找,路径如下:(D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ItemTemplates\CSharp\Code\2052
4分别.打开Class和Interface文件夹,将下面的Class.cs和Interface.cs文件打开,将版权拷贝到里面,单击保存,配置完成,重新打开VS即可
注:X未自定义输入
Class.cs
#region << 版 本 注 释 >>
/**************************************************************************** *Copyright (c) $year$ XXXXXX All Rights Reserved. *CLR版本: $clrversion$ *机器名称:$machinename$ *公司名称:XXXXXX *命名空间:$rootnamespace$ *文件名: $safeitemrootname$ *版本号: V1.0.0.0 *唯一标识:$guid10$ *当前的用户域:$userdomain$ *创建人: XXX *电子邮箱: *创建时间:$time$ *描述: *============================================================================ *修改标记 *修改时间:$time$ *修改人: XXXX *版本号: V1.0.0.0 *描述: *****************************************************************************/ #endregion
using System; using System.Collections.Generic; $if$ ($targetframeworkversion$ >= 3.5)using System.Linq; $endif$using System.Text; $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks; $endif$ namespace $rootnamespace$ { class $safeitemrootname$ { } }
|
Interface.cs
#region << 版 本 注 释 >> /**************************************************************************** *Copyright (c) $year$ XXXXXX All Rights Reserved. *CLR版本: $clrversion$ *机器名称:$machinename$ *公司名称:XXXXXX *命名空间:$rootnamespace$ *文件名: $safeitemrootname$ *版本号: V1.0.0.0 *唯一标识:$guid10$ *当前的用户域:$userdomain$ *创建人: XXXXXX *电子邮箱: *创建时间:$time$ *描述: *============================================================================ *修改标记 *修改时间:$time$ *修改人: XXXXXX *版本号: V1.0.0.0 *描述: *****************************************************************************/ #endregion
using System; using System.Collections.Generic; $if$ ($targetframeworkversion$ >= 3.5)using System.Linq; $endif$using System.Text; $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks; $endif$ namespace $rootnamespace$ { interface $safeitemrootname$ { } }
|