StreamReader str2 = new StreamReader("D:\\text.txt");
string str3=str2.ReadLine();
while (str3 != null)
{
Console.WriteLine(str3);
string[] arr = str3.Split(';');
//arr 就是数组了,arr[0] 是40, arr[1]是20,arr[2]是张三,每行依次类推
str3 = str2.ReadLine();
}
用字符串的 Split 方法