using System.IO; namespace 读一行TXT内容 { class Program { static void Main(string[] args) { string path = @"D:\123\123.txt"; string conTent; ; FileStream fs = new FileStream(path,FileMode.OpenOrCreate); using (StreamReader sr=new StreamReader(fs, Encoding.Default)) { do { conTent = sr.ReadLine(); Console.WriteLine(conTent); } while (conTent != null); } Console.ReadKey(); } } }