1、打开代码管理器

2、打开后就可以看到如下图所示

3、复制粘贴该路径,转到该文件夹下
新加一个txt文件,把下面的文本复制粘贴
?| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?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的代码片段复制粘贴,大胆修改后成功的。
愿大家的学习一路顺风。








发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。