Password for Redis with StackExchange.Redis

2019-05-14 09:05发布

问题:

How do you specify the password for the Redis server with StackExchange.Redis? I am guessing you add it to the configuration string which is passed to the Connect method. I can't seem to find the format in which it needs to be specified.

回答1:

I will add a full list of the key/value pairs to the configuration docs tomorrow. Short version is: probably "foo,password=value". Longer version is: use ConfgurationOptions and set .Password. The document shows you how to switch between the two layouts.