myList<int, string, string, string> my = new myList<int, string, string, string>();//mylist<mainkey,key1,key2,key3>,mainkey唯一,就算不唯一,下面的 my[mainkey].key1取值也默认取先添加的那个 my.add(100, "q", "w", "e"); my.add(101, "a", "s", "d"); my.add(102, "z", "x", "c"); int i =my.count; string s = my[100].key1;//取到q值 foreach(xxx xx in my) { int i = xx.mainkey; string n = xx.key1; }以上如何用c#实现?这个myList,xxx 的数据结构应该怎么写?
添加回答
举报
0/150
提交
取消