- StreamReader sr = new StreamReader("fileName.txt");
- string line;
- while((line= sr.ReadLine()) != null) {
- Console.WriteLine("xml template:"+line);
- }
- if (sr != null)sr.Close(); //should be in a "finally" or "using" block
- //该片段来自于http://www.codesnippet.cn/detail/221020136576.html
来源: http://www.codesnippet.cn/detail/221020136576.html