zoukankan      html  css  js  c++  java
  • 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();
  • 相关阅读:
    js 字符串转化成数字
    web项目中各种路径的获取
    个人作业——软件工程实践总结作业
    Beta 答辩总结
    Beta 冲刺 (7/7)
    Beta 冲刺 (6/7)
    Beta 冲刺 (5/7)
    Beta 冲刺 (4/7)
    Beta 冲刺 (3/7)
    软件产品案例分析(团队)
  • 原文地址:https://www.cnblogs.com/xbblogs/p/4753663.html
Copyright © 2011-2022 走看看