下面是关于StreadReader的使用例子。

 

完整代码如下:

引入命名空间:

using System.IO;  

完整代码:

namespace StreamReaderApp  
{
class Program
{
static void Main(string[] args)
{
string s = "";
using (StreamReader sr = new StreamReader("c:\\file1.txt"))
{
s = sr.ReadToEnd();
}
Console.WriteLine(s);
Console.ReadLine();
}
}
}

 


参考:http://www.wxzzz.com/?id=32

相关文章:

  • 2021-06-18
  • 2022-01-05
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案