【C#学习笔记】读文件
using System; using System.IO; namespace ConsoleApplication { class Program { static void Main(string[] args) { FileStream file = new FileStream("log.txt", FileMode.OpenOrCreate); StreamReader sr = new StreamReader(file); string a = sr.ReadToEnd(); Console.Write(a); sr.Close(); Console.Read(); } } }