您的位置:首页 > 数据库 > Redis

Nosql 之 Redis(可做缓存 )

2016-05-12 01:10 531 查看
下载 可以下载解压安装的 地址: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();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: