private void button2_Click(object sender, EventArgs e)
{
string filePath = "";
OpenFileDialog opd = new OpenFileDialog();
if (opd.ShowDialog() == DialogResult.OK)
{
filePath = opd.FileName;
}
StreamReader sr = new StreamReader(filePath,Encoding.Default);
string s = sr.ReadLine();
while (sr.ReadLine()!=null)
{
textBox1.Text+=s + "\r\n";
s = sr.ReadLine();
}
}
创建一个10行的文本,为什么只能读出来奇数行?无法全部读出来,怎么解决?