下载 可以下载解压安装的 地址: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();
        }

 

相关文章:

  • 2022-01-12
  • 2021-08-14
  • 2022-01-02
  • 2021-10-08
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案