zoukankan      html  css  js  c++  java
  • Hashtable的简单实用

    程序中经常会用到键值对儿去存储数据,用到的最多的是字典,和哈希表,下面的是一个简单例子

     class Program
        {
            static void Main(string[] args)
            {
                Hashtable hash = new Hashtable();//实例化hash
                hash.Add("1""1");//赋值
                hash.Add("2""2");
                hash.Add("3""3");
                hash.Add("4""4");
                hash.Add("5""5");
                foreach (DictionaryEntry dic in hash)//通过DictionaryEntry 去遍历哈希中的键值对 
                {
                    Console.WriteLine("Key:{0}  Value:{1}", dic.Key.ToString(), dic.Value.ToString());
                }
                Console.ReadKey();
                
            }
        }
    一个简单的例子
  • 相关阅读:
    慕课网 k8s环境搭建坑点
    这种yum源为阿里云
    linux yum安装jdk
    docker 常用命令
    docker部署
    docker windows安装 就是这么简单
    idea
    jrebel 破解失败 Unexpected response from server
    bladex flowable 表关系
    bladex 接口
  • 原文地址:https://www.cnblogs.com/BungeeJumping/p/2373601.html
Copyright © 2011-2022 走看看