C#文件读写
我刚学C#,想写个基数排序算法,想从文本文件中读数据,文本文件中每行数据作为一条记录,记录由几个关键字,各关键字之间用","隔开,怎样实现
StreamReader sr = new StreamReader("d:\\t.txt");
string line = sr.ReadLine();
string info = "";
while(line != null)
{
info += line;
line = sr.ReadLine();
}
string[] s = info.Split(new char[]{','});
foreach(string c in s)
{
Console.WriteLine(c);
}