社区
C#
帖子详情
怎么遍历Hashtable啊!
yizhixiaozhu
2005-01-25 12:30:24
如题,哪位大大知道吗?
...全文
304
4
打赏
收藏
怎么遍历Hashtable啊!
如题,哪位大大知道吗?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yizhixiaozhu
2005-01-25
打赏
举报
回复
谢谢
AustinLei
2005-01-25
打赏
举报
回复
Hashtable ht = new Hashtable();
ht.Add("a","1");
ht.Add("b","2");
foreach (String s in ht.Values)
{
MessageBox.Show(s);
}
sprrav
2005-01-25
打赏
举报
回复
foreach(DictionaryEntry de in yourHT)
{}
chinacc
2005-01-25
打赏
举报
回复
用foreach语句啊。例子:
using System;
using System.Collections;
public class CollectionClass
{
public static void Main()
{
Hashtable Coursehash = new Hashtable();
Coursehash.Add("01", "这是01");
Coursehash.Add("02", "这是02");
Coursehash.Add("03", "这是03");
foreach (string s in Coursehash.Keys)
{
Console.WriteLine(s + " " + Coursehash[s]);
}
Console.ReadLine();
}
}
asp.net
遍历
hashtable
利用asp.net
遍历
hashtable
中的值
Java 实例 -
遍历
HashTable
的键值源代码+详细教程.zip
Java 实例 -
遍历
HashTable
的键值源代码+详细教程.zip
Java 实例 - 使用 Enumeration
遍历
HashTable
源代码+详细指导教程.zip
Java 实例 - 使用 Enumeration
遍历
HashTable
源代码+详细指导教程.zip
遍历
Hashtable
的几种方法
遍历
Hashtable
的几种方法
C#中
遍历
Hashtable
的4种方法
直接上代码,代码中使用四种方法
遍历
Hashtable
。 using System; using System.Collections; namespace
Hashtable
Example { class Program { static
Hashtable
hashtable
= new
Hashtable
(); static void Main(string[] args) {
hashtable
.Add(first, Beijing);
hashtable
.Add(second, Shanghai);
C#
110,561
社区成员
642,566
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章