把txt文本一行一行的读出来,往datagridview上面加,
sr = new ("text.txt");
while (!sr.EndOfStream)
{
string[] items = sr.ReadLine().Split(',');
datagridview1.Rows.Add();
datagridview1.Rows[datagridview1.Rows.Count - 1].Cells[0].Value = items[0];
datagridview1.Rows[datagridview1.Rows.Count - 1].Cells[1].Value = items[1];
datagridview1.Rows[datagridview1.Rows.Count - 1].Cells[2].Value = items[2];
}
sr.Close();