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
                 
                }
    

      

  • 相关阅读:
    hdu 6188 Duizi and Shunzi
    区间第k大
    AtCoder Regular Contest 081 E
    hdu 6170 Two strings
    hdu 6156 Palindrome Function
    2017百度之星初赛(B)-1006-小小粉丝度度熊 hdu 6119
    AtCoder Regular Contest 080 E
    hdu 6069 Counting Divisors
    hdu 6058 Kanade's sum (多校3)
    苹果曼和树
  • 原文地址:https://www.cnblogs.com/wucg/p/3033421.html
Copyright © 2011-2022 走看看