一、修改方法
文件路径:D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ItemTemplates\CSharp\Code\2052\Class\Class.cs
注意替换为自己的文件路径
Class.cs默认文件内容
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$
{
}
}
在头部加上自己需要的注释
/**
* Namespace: $rootnamespace$
*
* Function: N/A
* Name: $safeitemname$
*
* Ver Time Author
* 0.10 $time$ Hx7013
*
*/
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$
{
}
}
效果展示
二、提示无权限解决方法
操作步骤:
- 右键Class.cs,选择属性
- 点击安全选项卡
- 选中Users组
- 点击编辑
- 选中Users组
- 勾选修改属性(同步应该会自动勾上写入属性)
- 点击确定关闭Class.cs 的权限窗口
- 点击确定关闭Class.cs 属性窗口
转载请注明:https://blog.csdn.net/hx7013/article/details/104490931