Redis
2015-08-24 00:35
387 查看
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();
相关文章推荐
- Redis
- redis sentinel 主从切换(failover)解决方案,详细配置
- 十个正确使用 Redis 的技巧
- Redis-链表类型操作
- Redis字符串类型操作
- redis源码分析
- Redis集群方案的对比
- Redis分片
- redis实现访问频次限制的几种方式
- nginx+lua+redis构建高并发应用
- Redis学习笔记(5)
- python redis
- redis持久化RDB和AOF
- redis集群(主从配置)
- VMware搭建虚拟机安装redis并实现局域网通信
- centos 5.5 安装redis2.4.17
- Redis学习笔记(4)
- redis
- redis特点以及安装
- redis系列