博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Visual Studio] 自定义类模板
阅读量:7022 次
发布时间:2019-06-28

本文共 1099 字,大约阅读时间需要 3 分钟。

1.找到vs2015/vs2012/vs2017的安装目录下:Common7\IDE\ItemTemplates\CSharp\Code\2052\Class

2.打开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$    {    }}

3.修改Class.cs文件

/************************************* 创建人:Administrator* 创建时间:$time$* 版权所有:个人***********************************/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$    {    }}

4.在vs中新建一个类

/************************************* 创建人:Administrator* 创建时间:2017/12/26 15:32* 版权所有:个人***********************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Test{    class TestClass    {    }}

 

转载于:https://www.cnblogs.com/licin/p/8118275.html

你可能感兴趣的文章
YbSoftwareFactory 代码生成插件【五】:具有超炫界面效果的WPF完整解决方案的代码生成插件...
查看>>
SQL Server : 使用SQL Express的User Instance(用户实例)特性
查看>>
git命令颜色设置
查看>>
2016京东编程题:年终奖
查看>>
android NDK编程:使用posix多线程与mutex相互排斥同步
查看>>
Sublime Text 全程指引 by Lucida
查看>>
OpenGL ES testing
查看>>
Android 的窗口管理系统 (View, Canvas, WindowManager)
查看>>
从 Qt 的 delete 说开来
查看>>
[Postgres] Create a Postgres Table
查看>>
如何推断一个P2P平台是否靠谱?
查看>>
Spring学习【Spring概述】
查看>>
一起学编程(3--组织与表达)
查看>>
ROS+L2TP+IPSEC
查看>>
【Java数据结构学习笔记之一】线性表的存储结构及其代码实现
查看>>
零代码如何打造自己的实时监控预警系统
查看>>
Sql server Always On 读写分离配置方法
查看>>
鸡肋点搭配ClickJacking攻击-获取管理员权限
查看>>
垃圾收集器
查看>>
基于Redis+Kafka的首页曝光过滤方案
查看>>