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();
}
}
}
浙公网安备 33010602011771号