Hashtable 特点:键与值成对存在,键是唯一的,不能重复。在查找元素的时候,我们往往是依据键区查找值的

三种方法

  contains   包含

  containsKey

  containsValue

通常我们只用containsKey方法

 class Program
{
static void Main(string[] args)
{
Hashtable ht = new Hashtable();
ht.Add(, "张三");
ht.Add(, "张四");
ht.Add(, "李三");
ht.Add(, "王三");
ht.Add(, "刘三");
ht.Add(, "孙三");
foreach (DictionaryEntry item in ht)
{
Console.WriteLine("键{0},值{1}",item.Key,item.Value);
} if (ht.ContainsKey())
{
Console.WriteLine("存在");
}
else
{
Console.WriteLine("不存在");
}
Console.Read();
}

最新文章

  1. DigitalOcean 建站笔记
  2. ZEALER背后的乐视云视频
  3. 让你的PHP更安全之PHP.ini
  4. UDP socket 设置为的非阻塞模式
  5. C#局域网桌面共享软件制作(二)
  6. Linux系统管理员应该了解的一些I/O统计工具
  7. 新型Web劫持技术
  8. 深入理解JAVA虚拟机之JVM性能篇---垃圾回收
  9. python为运维人员打造一个监控脚本
  10. POJ-1032-拆数字
  11. symfony简单的博客练习,熟悉具体开发流程
  12. django的分页与添加图片
  13. php7 数据导出Excel office 2011中文乱码问题
  14. C# 委托知识总结
  15. Linux CentOS Nginx安装配置
  16. oracle--ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
  17. HDU.5730.Shell Necklace(分治FFT)
  18. MySQL数据复制到其他主机时报错
  19. spring结合mockito
  20. Knockout.js Style绑定

热门文章

  1. memcached装、启动和卸载
  2. Codeforces Round #551 (Div. 2)A. Serval and Bus
  3. 【bzoj4806~bzoj4809】 象棋四连发 DP-高精度-匈牙利算法-dfs
  4. map/fileter
  5. luoguP3415 祭坛
  6. 了解一个名词——GTD
  7. spring security之logoutHandler中的CookieClearingLogoutHandler
  8. 文件管理NSFileManager
  9. jquery遇到的坑
  10. 在URL地址栏中显示ico