首页 > 数据库技术 > 详细

Nosql 之 Redis(可做缓存 )

时间:2016-05-12 06:50:05      阅读:245      评论:0      收藏:0      [点我收藏+]

下载 可以下载解压安装的 地址:https://github.com/dmajkic/redis/downloads

修改 redis.conf

取消注释 requirepass foobared
运行 redis-server
运行 redis-cli
授权 auth foobared

下载 nuget包 ServiceStack.Redis

c#

static void Main(string[] args)
        {
            string host = "127.0.0.1";
            string elementKey = "testKey";
            int port = 6379;

            RedisClient rc = new RedisClient(host, port, "foobared");

            rc.Set(elementKey, "hello redis");

            string res = rc.Get<string>(elementKey);
            Console.WriteLine(res);

            Console.ReadLine();
        }

 

Nosql 之 Redis(可做缓存 )

原文:http://www.cnblogs.com/nele/p/5484202.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!