Ejemplo n.º 1
0
        /// <summary>
        /// 字符串
        /// </summary>
        private void ShowStr()
        {
            RedisDb.Set("StrKey1", new List <int> {
                1, 2, 3, 4, 5
            });
            RedisDb.Set("StrKey2", new { Name = "LGn", Age = 18 });
            RedisDb.Set("StrKey3", new[] { new { Name = "LGn", Age = 18 } });

            WriteColorLine(RedisDb.Get("StrKey1"), ConsoleColor.Green);
            WriteColorLine(RedisDb.Get("StrKey2"), ConsoleColor.Green);
            WriteColorLine(RedisDb.Get("StrKey3"), ConsoleColor.Green);


            RedisDb.Set("Incr1", 5);
            RedisDb.Set("Incr2", 5);


            RedisDb.IncrBy("Incr1");

            //异常
            //RedisDb.Set("Incr3", "Abc");
            //RedisDb.IncrBy("Incr3");
        }