zoukankan      html  css  js  c++  java
  • redis学习

    官网: http://redis.io

    中文翻译: http://redis.cn/

    windows预编好的版本下载:

    https://github.com/dmajkic/redis/downloads

    客户端API:

    C#

    ServiceStack.Redis  Homepage demisbellot This is a fork and improvement of the original C# client written by Miguel De Icaza.
    Booksleeve   Homepage marcgravell

    This client was developed by Stack Exchange for very high performance needs.

    https://github.com/ServiceStack/ServiceStack.Redis

    文档: https://github.com/ServiceStack/ServiceStack.Redis/wiki

    http://code.google.com/p/booksleeve/ 

    附: Fastest JSON Serializer for .NET released

    http://www.servicestack.net/mythz_blog/?p=344

    ServiceStack.Redis 客户端IP是比较复杂强大的,可惜目前只支持 .net framework 2.0, 3.5

    示例:

     IRedisClient client = new RedisClient("127.0.0.1", 6379);
                //存储用户名和密码  
                client.Set<string>("email", "gg@qq.com");
                client.Set<int>("age", 123456);
                string email = client.Get<string>("email");
                int age = client.Get<int>("age");
                client.Set<decimal>("weight", 12.10M);
                decimal weight = client.Get<decimal>("weight");
    
                Console.WriteLine("email:" + email);
                Console.WriteLine("age:" + age);
                Console.WriteLine("weight:" + weight);
    

      

    Booksleeve 相比轻量级得多,支持.net framework 4.0.

    示例:

     using (var conn = new RedisConnection("localhost"))
                {
                    conn.Open();
                    conn.Strings.Set(0, "hello", "中国!@#$!@#$");
                    
                    var value = conn.Strings.GetString(0, "hello");
                    string sRet = conn.Wait(value);
                    Console.WriteLine(sRet);
                    
                    //conn.Lists
                    //conn.Hashes
                    //conn.Sets
                    //conn.SortedSets
                 
                }
    

      

  • 相关阅读:
    浅谈C#托管程序中的资源释放问题
    c#基本语法学习笔记
    深入剖析C#多态性
    Reporting Services API
    进程和线程的区别
    化妆品网站,饰品网站
    宠物销售网站
    卖地方特色才产品,类似湖南味道那样的网上专卖店
    建立友情链接联盟
    DIY最残忍U盘
  • 原文地址:https://www.cnblogs.com/wucg/p/3033421.html
Copyright © 2011-2022 走看看