急求C#读取txt文件内容到DataGridView空间文本

2025-03-24 12:13:36
推荐回答(1个)
回答1:

//string path = textBox1.Text;
// StreamReader sr = new StreamReader(path, Encoding.GetEncoding("gb2312"));//读取文件
// string str=null;
// while ((str = sr.ReadLine()) != null)//判断行
// {
// listBox1.Items.Add(str);
// }