Redis
- https://github.com/MSOpenTech/redis
- 点击链接:Download ZIP,并解压缩至本地文件夹
- 进入文件夹:.\redis-3.0\msvs,使用Visual Studio打开文件RedisServer.sln
- Build设置为X64,Release,编译整个Solution,Build完成之后,将以下文件拷贝到指定文件夹(比如: d:\RedisServer\)。
redis-benchmark.exe
redis-check-aof.exe
redis-check-dump.exe
redis-cli.exe
redis-server.exe
同时,将根目录下的文件.\redis-3.0\redis.conf同样拷贝到此指定文件夹,完成之后如下图所示:
ServiceStack.Redis
- 在Windows下使用Redis,我们需要第三方驱动,此处我们使用的是ServiceStack.Redis.
访问以下地址:https://github.com/ServiceStack/ServiceStack.Redis Download ZIP
- 解压缩并打开Solution: .\ServiceStack.Redis-master\src\ServiceStack.Redis.sln;Build配置为X64, Release
编译之后文件生成在文件夹:.\ServiceStack.Redis-master\src\ServiceStack.Redis\bin\Release下:
- 新建一个控制台工程,将以上*.dll文件引入工程,添加以下代码:
using ServiceStack.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RedisDemo
{
class Program
{
static RedisClientredisclient = new RedisClient("10.86.20.82", 6379);
static void Main(string[] args)
{
C1 c = new C1(){Name = "abc", Age = 22};
redisclient.Set<C1>("c1", c);
redisclient.Save();
C1 c1 =redisclient.Get<C1>("c1");
Console.WriteLine(c1.Name + "-" + c1.Age);
}
public class C1
{
public string Name{ get; set; }
public int Age {get; set; }
}
}
}
- RedisClient API
https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisClient
Redis UI Tools
RedisReact:
https://github.com/ServiceStackApps/RedisReact
RedisDesktop:
http://redisdesktop.com/download
https://github.com/uglide/RedisDesktopManager/wiki/Quick-Start
https://github.com/ServiceStack/ServiceStack.Redis/wiki/Useful-Redis-Links