• Redis


    Redis的数据类型

     var client = new RedisClient("127.0.0.1", 6379);
                //client.Set<string>("name", "zhangsan");
                //string name= client.Get<string>("name");
                // client.Set<int>("age", 13);
                // Console.WriteLine(name);
    
                //  client.SetEntryInHash("userId", "username1", "lisi");
                //  client.SetEntryInHash("userId", "age", "23");
    
                //// List<string>list= client.GetHashKeys("userId");
                //  List<string> list = client.GetHashValues("userId");
                // foreach (string key in list)
                // {
                //     Console.WriteLine(key);
                // }
    
    
                //client.EnqueueItemOnList("userName", "wangwu");//入队(先进先出.)
                //client.EnqueueItemOnList("userName", "qianqi");
                //int count=client.GetListCount("userName");
                //for (var i = 0; i <count; i++)
                //{
                //   Console.WriteLine(client.DequeueItemFromList("userName"));//出队.
                //}
    
                //client.PushItemToList("name3", "maliu");//入栈
                //client.PushItemToList("name3", "maliu333");
                //int count = client.GetListCount("name3");
                //for (var i = 0; i < count; i++)
                //{
                //    Console.WriteLine(client.PopItemFromList("name3"));//出栈
                //}
    
    
                client.AddItemToSet("a3", "ddd");
                client.AddItemToSet("a3", "ccc");
                client.AddItemToSet("a3", "tttt");
                client.AddItemToSet("a3", "sssh");
                client.AddItemToSet("a3", "hhhh");
                System.Collections.Generic.HashSet<string> hashset = client.GetAllItemsFromSet("a3");
                foreach (string str in hashset)
                {
                    Console.WriteLine(str);
                }
    
    
                Console.ReadKey();
  • 相关阅读:
    判断二叉树是否是完全二叉树
    二叉搜索树的第k个节点
    二叉树的深度
    二叉搜索树与双向链表
    二叉搜索树的后序遍历序列
    poj 2192 (DP)
    poj 1159 (DP LCS)
    poj 1934(LCS)
    《编程之美》读书笔记 -- 1.2中国象棋问题
    poj 1050(DP)
  • 原文地址:https://www.cnblogs.com/xbblogs/p/4753663.html
Copyright © 2020-2023  润新知