NuGet先安装StackExchange.Redis.StrongName
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("127.0.0.1:6379,password=mima");
IDatabase db = redis.GetDatabase(2);
if (db.StringSet("testKey", "ssssss22222"))
{
var val = db.StringGet("testKey");
Console.WriteLine(val);
}
来源:oschina
链接:https://my.oschina.net/u/4283481/blog/4133424