0:介绍 百度百科or官网

1:下载  选择32位或者64

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

1.1下载后如图

1.2文件介绍

redis-server.exe:服务程序 
redis-check-dump.exe:本地数据库检查
redis-check-aof.exe:更新日志检查
redis-benchmark.exe:性能测试,用以模拟同时由N个客户端发送M个 SETs/GETs 查询.
redis-cli.exe: 服务端开启后,我们的客户端就可以输入各种命令测试了

2:安装

2.1盘新建目录 名称 redis(任意取 只要符合windows命名要求就ok)

2.2 将下载的32bit复制到新建redis目录下(2.1、2.2 可以合并 看个人习惯)

3启动redis服务

:启动 cmd  win+r
1.1 d:
1.2 cd redis
1.3 redis-server.exe redis.conf

默认端口 6379 redis

此时redis 启动成功

4:1-3是以cmd窗口方式  在正式使用明显不合理 我们希望以windows服务的网上安装

4.1地址 https://github.com/rgl/redis/downloads

4.2安装后  windows服务里面就能找到

5 c# code 操作 redis

装备工作 vs10 redis dll

code demo:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServiceStack.Redis; namespace redisDemo
{
class Program
{
static void Main(string[] args)
{
//建立socket连接 指定redis 安装的ip 和端口 6379 是默认
var client = new RedisClient("127.0.0.1", ); //设置值
client.Set<string>("userName", "lsw"); //取值
var getUserName1 = client.Get<string>("userName"); Console.WriteLine(getUserName1); //设置值2(重复的key redis 覆盖值)
client.Set<string>("userName", "lsw2"); //取值
var getUserName2 = client.Get<string>("userName"); Console.WriteLine(getUserName2); //hash (适合存对象)
client.SetEntryInHash("js", "name", "AngularJS");
client.SetEntryInHash("js", "name1", "node");
client.SetEntryInHash("js", "name2", "React");
var key = client.GetHashKeys("js");
var value = client.GetHashValues("js"); // 若存在,则删除
if (client.Exists("cs") > )
{
client.Del("cs");
}
//队列 先进先出
client.EnqueueItemOnList("cs", "hello");//入队。
client.EnqueueItemOnList("cs", "world");
int length = client.GetListCount("cs");
for (int i = ; i < length; i++)
{
Console.WriteLine(client.DequeueItemFromList("cs"));//出队.
} if (client.Exists("demo") > )
{
client.Del("demo");
}
//入栈 先进后出
client.PushItemToList("demo", "hello");
client.PushItemToList("demo", "world");
int temp = client.GetListCount("demo");
for (int i = ; i < temp; i++)
{
Console.WriteLine(client.PopItemFromList("demo"));//出栈.
} //set 并集,交集,差集.
client.AddItemToSet("demo", "a");
client.AddItemToSet("demo", "e");
client.AddItemToSet("demo", "c");
client.AddItemToSet("demo", "d");
client.AddItemToSet("cs", "e");
client.AddItemToSet("cs", "f");
client.AddItemToSet("cs", "f"); HashSet<string> hashset = client.GetAllItemsFromSet("demo");
foreach (string str in hashset)
{
Console.WriteLine(str);
} //求交集
HashSet<string> jj = client.GetIntersectFromSets(new string[] { "demo", "cs" });
//求差集.
HashSet<string> bj = client.GetDifferencesFromSet("demo", new string[] { "cs" }); Console.ReadKey();
}
}
}

5: redis 主从复制 、其他??

5.1 I don't know, I'm in my study.

redis 客户端可视化工具下载:

https://redisdesktop.com/download

最新文章

  1. 前端开发:Javascript中的数组,常用方法解析
  2. WPF中获取鼠标相对于桌面位置
  3. windows下修复Linux引导 and linux下几个常用软件
  4. Linux 命令行快捷键
  5. UML系列05之 基本流程图
  6. 用类求圆面积c++
  7. 获取SqlDataReader的列名
  8. group by调优的一些测试
  9. BZOJ 1051: [HAOI2006]受欢迎的牛 缩点
  10. 自动化测试实施的几个idea
  11. Jquery对回复者添加匿名评论选项
  12. mysql源码安装(5.1)
  13. JavaScript调试技巧
  14. OKMX6Q LTIB编译
  15. yum 出问题了
  16. AI应用开发实战 - 手写识别应用入门
  17. 【.NET】 C# 时间戳和DataTime 互相转换
  18. mysql 聚集函数 count 使用详解(转载)
  19. c# 接口的协变和逆变
  20. dp的斜率优化

热门文章

  1. 【jQuery】 jQuery上下飘动效果
  2. mstsc 远程序桌面登录的 c#开发
  3. linux 中文件权限和磁盘管理、linux服务器项目如何部署
  4. requestAnimationFrame,Web中写动画的另一种选择
  5. JQurey
  6. SVN集中式版本控制器的安装、使用与常见问题汇总
  7. a冲刺总结随笔
  8. RFID-RC522、FM1702SL、M1卡初探
  9. BigDecimal 加减乘除
  10. 机器学习笔记-----Fisher判别式