• 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
                 
                }
    

      

  • 相关阅读:
    Linux 命令查找文件中某个字段所存在的位置
    PHP in_array() 函数
    php一维数组如何追加到二维数组
    电脑切换窗口
    微擎前端逻辑判断的时弹框
    JDBC批量处理
    数据库事务
    处理BLOB
    JDBC自动生成主键值
    JDBC的元数据
  • 原文地址:https://www.cnblogs.com/wucg/p/3033421.html
Copyright © 2020-2023  润新知