从哈希表中检索值 [英] retrieving values from hash table

查看:84
本文介绍了从哈希表中检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi

i m 我正在使用 a 哈希表来保留键值对. in 哈希表 as 的值为 im ,我将其存储在 a 结构中 . the 结构再次包含一个List<string> ,其中带有in ,因此 I 需要检索使用 the 哈希表键检索 the 结构字段.

请让我知道如何 我可以做到这一点.

A advance 中表示感谢.

hi,

i m I am using a hashtable to keep key value pairs,. in The hashtable as has a value i m I am storing in a structure,. the The structure again contains a List<string> with in within it, so I need to retrive retrieve the structure fields with the hashtable key.

Please let me know how can i I can do this.

Thanks in Aadvance.

推荐答案

如果我理解您的问题,那么您需要这样做:

If I understand your question, you want this:

Arraylist list = new ArrayList();
list.add("test");

Hashtable hash = new Hashtable();
hash.add("ui", list);


list = hash["ui"] as Arraylist


您可以使用Linq进行操作. Google是您的朋友.
You can do it with Linq. Google is your friend.


这篇关于从哈希表中检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆