一、修改方法
文件路徑: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