VS2015为console.readkey添加代码片段的方法
作者:舍名利 时间:2023-11-15 05:23:41
1、打开代码管理器
2、打开后就可以看到如下图所示
3、复制粘贴该路径,转到该文件夹下
新加一个txt文件,把下面的文本复制粘贴
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ck</Title>
<Shortcut>ck</Shortcut>
<Description>Console.ReadKey 的代码片段</Description>
<Author>jinglingzi</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$SystemConsole$.ReadKey();$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
把文件的后缀名改为 .snippet.
4、你在写代码的地方,ck 然后两下tab键,console.readkey就出来了。
技巧:
5、<Code Language="csharp"><![CDATA[$SystemConsole$.ReadKey();$end$]]>
这行代码中的,$end$,是光标停止的位置。
6、我其实也不会怎么写代码片段,就是把cw的代码片段复制粘贴,大胆修改后成功的。
愿大家的学习一路顺风。
标签:console.readkey,添加代码片段
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
C#游戏开发之实现华容道游戏
2023-01-03 03:17:20
![](https://img.aspxhome.com/file/2023/8/75588_0s.jpg)
spring AOP的Around增强实现方法分析
2021-10-03 06:22:39
Dubbo retries 超时重试机制的问题原因分析及解决方案
2023-11-29 08:22:38
Android实现拼图小游戏
2023-03-01 11:25:46
![](https://img.aspxhome.com/file/2023/6/93326_0s.jpg)
c# 成员类型访问权限低于字段本身的实现
2021-12-23 07:08:27
![](https://img.aspxhome.com/file/2023/9/78129_0s.png)
java list随机抽取元素的案例
2023-12-22 22:21:59
![](https://img.aspxhome.com/file/2023/0/71920_0s.jpg)
struts2实现多文件上传的示例代码
2022-03-09 23:40:54
Mybatis中连接查询和嵌套查询实例代码
2021-08-23 13:24:31
Mybatis查询多条记录并返回List集合的方法
2023-08-08 05:16:48
Android实现点击某个按钮指定位置弹出布局
2023-04-10 16:09:59
![](https://img.aspxhome.com/file/2023/5/137805_0s.jpg)
Spring中自动装配的4种方式
2021-08-01 16:44:41
Android 自定义View实现任意布局的RadioGroup效果
2021-08-07 16:20:24
![](https://img.aspxhome.com/file/2023/2/128992_0s.gif)
MyBatis Plus插件机制与执行流程原理分析详解
2021-10-09 20:53:48
![](https://img.aspxhome.com/file/2023/5/77155_0s.jpg)
Java实现的求解经典罗马数字和阿拉伯数字相互转换问题示例
2023-10-15 23:17:36
![](https://img.aspxhome.com/file/2023/9/64789_0s.png)
Springboot处理配置CORS跨域请求时碰到的坑
2023-12-20 11:40:45
![](https://img.aspxhome.com/file/2023/3/95983_0s.png)
Android多渠道打包的方法步骤
2022-10-17 12:05:07
![](https://img.aspxhome.com/file/2023/4/91024_0s.png)
elasticsearch索引index之engine读写控制结构实现
2021-12-22 00:08:07
![](https://img.aspxhome.com/file/2023/9/61299_0s.jpg)
c#的params参数使用示例
2021-10-07 04:53:39
Java多种经典排序算法(含动态图)
2023-09-24 00:45:02
![](https://img.aspxhome.com/file/2023/3/84243_0s.png)
.net实现序列化与反序列化实例解析
2022-08-05 06:42:08