[C#] C# StreamReader读取文件 →→→→→进入此内容的聊天室

来自 , 2020-01-02, 写在 C#, 查看 113 次.
URL http://www.code666.cn/view/4b4c6c20
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace W
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             using (StreamReader sr = new StreamReader (@"c:\1.txt",Encoding.UTF8,true))
  14.             {
  15.                 while (!sr.EndOfStream)
  16.                 {
  17.                     Console.WriteLine(sr.ReadLine());
  18.                 }
  19.             }
  20.             Console.WriteLine("读取完毕");
  21.             Console.ReadKey();
  22.         }
  23.     }
  24. }
  25. //csharp/5479

回复 "C# StreamReader读取文件"

这儿你可以回复上面这条便签

captcha