using System;
using System.Collections.Specialized;
using System.IO;
var lines = File.ReadAllLines("1.txt");
var dict = new StringDictionary();
string[] arr;
int idx;
foreach(var line in lines){
arr = line.Split(':');
dict.Add(arr[0],arr[1]);
}
你好!你的每行数据都是个顶格式的吗?把txt文件内容发一下