• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
wood132
博客园    首页    新随笔    联系   管理    订阅  订阅

缓存 Redis

redis
http://try.redis.io/
https://redis.io/
 
windows下安装
下载redis for windows
https://github.com/MSOpenTech/redis/releases
Redis-x64-3.2.100.zip
 
安装 为服务
redis-server --service-install redis.windows-service.conf --loglevel verbose
启动
redis-server --service-start
连接
redis-cli.exe
 或 redis-cli -h 127.0.0.1 6379
 
测试
set name pan
get name
 
 

 

set city shanghai
get city
 
参考
代码
 
c#操作redis :
新建控制台程序
安装程序集 Install-Package ServiceStack.Redis
上述命令安装了4个程序集:

 

代码:
static RedisClient redisClient = new RedisClient("127.0.0.1", 6379);//redis服务IP和端口
        static void Main(string[] args)
        {
            Console.WriteLine(redisClient.Get<string>("city"));
            Console.ReadKey();
        }

 

 
使用Redis实现分布式系统日志统一管理
posted @ 2017-03-19 22:54  wood132  阅读(94)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3