StreamReader读取资料

StreamReader读取文件using Systemusing System.Collections.Genericusing System.IOusing System.Linq

StreamReader读取文件

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace W
{
    class Program
    {
        static void Main(string[] args)
        {
            using (StreamReader sr = new StreamReader (@"c:\1.txt",Encoding.UTF8,true))
            {
                while (!sr.EndOfStream)
                {
                    Console.WriteLine(sr.ReadLine());
                }
            }
            Console.WriteLine("读取完毕");
            Console.ReadKey();
        }
    }
}