///?<summary>
///?泛型字典
///?</summary>
///?<typeparam?name="T"></typeparam>
public?class?MyDic<T>{?
private?Dictionary<T,?T>?dic?=?new?Dictionary<T,?T>();
public?MyDic(){?}
~MyDic()?{?}
public?void?Add(T?_key,T?_value)
{
dic.Add(_key,?_value);
}
}
//?使用:
MyDic<int>?mdAsInt?=?new?MyDic<int>();
mdAsInt.Add(1,?10);
mdAsInt.Add(2,?20);
MyDic<string>?mdAsString?=?new?MyDic<string>();
mdAsString.Add("A",?"ABC");
mdAsString.Add("B",?"DEF");