c#分割

Hashtable h = new Hashtable();
ArrayList l = new ArrayList();
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\尘梦\Desktop\root.txt", Encoding.Default);
int[] scores = new int[lines.Length];
int[] years = new int[lines.Length];
for (int i = 0; i < lines.Length; i++)
{
string rot = lines[i];
string[] rots = rot.Split('|');
scores[i] = Convert.ToInt32(rots[2]);
years[i] = Convert.ToInt32(rots[3]);

}
h.Add(years, scores);
l.AddRange(scores);
l.AddRange(years);

 

posted @ 2015-10-23 11:38  尘梦  阅读(164)  评论(0编辑  收藏  举报