关于C#中文本模板(.tt)的简单应用
2020-12-13 15:58
标签:http io ar os for sp 文件 div on 这两天做项目突遇 .tt文件,之前没有接触过,so查询学习做笔记,帮助记忆和后来者。 在项目添加中点击选择文本模板 下面贴出代码,做了简单的注释 Ctrl+S保存后,自动生成cs文件,很好很强大! THE END 关于C#中文本模板(.tt)的简单应用 标签:http io ar os for sp 文件 div on 原文地址:http://www.cnblogs.com/victor-wxy/p/4077930.html转自http://www.it165.net/pro/html/201409/21789.html

01."false" hostspecific="false" language="C#" #>02."System.Core" #>03.namespace="System.Linq" #>04.namespace="System.Text" #>05.namespace="System.Collections.Generic" #>06.".cs" #> //生成的文件格式,文件名称同文本模板名称相同07.
08.//正文
09.new string [] {"Name", "Age", "Education"}; #>10.class AutoCreate
11.{
12.for(int i= 0; i13.public static string ;
14.
15.}
1.观察一下这种输出格式和asp.net在页面上输出时写是一个模式.
2.中的context就被编译器直接运行,而之外的内容当做文本直接输出

上一篇:WebMail