c# richtextbox 读取txt文件只显示最后一行
FileStreamfs=newFileStream(openFileDialog1.FileName,FileMode.Open);StreamReaderfd=new...
FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open);
StreamReader fd = new StreamReader(fs);
fd.BaseStream.Seek(0, SeekOrigin.Begin);
while (fd.Peek() > -1)
{
richTextBox1.Text = fd.ReadLine();
}
fd.Close();
fs.Close();
} 展开
StreamReader fd = new StreamReader(fs);
fd.BaseStream.Seek(0, SeekOrigin.Begin);
while (fd.Peek() > -1)
{
richTextBox1.Text = fd.ReadLine();
}
fd.Close();
fs.Close();
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询