日期:2014-05-18 浏览次数:20990 次
string[] line=File.ReadAllLines("e:\a.txt"); int lines = line.Length;
------解决方案--------------------
StreamReader txtReader = new StreamReader(Application.StartupPath + "\\aa.txt.txt");
string[] reader = new string[100];
for (int i = 0; i < 100; i++)
{
reader[i] = txtReader.ReadLine();
if (reader[i] == null)
return;
}
把txt里面的内容读到一个数组中
------解决方案--------------------