读一行TXT内容 C#
作者:互联网
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(); } } }
标签:Console,string,C#,一行,conTent,FileStream,new,using,TXT 来源: https://www.cnblogs.com/bhnian/p/16338964.html