ServiceStack.Redis-4.5.0.0是一款无限使用的Redis客户端库,专为.NET开发者设计。该版本额外提供了一套全面的测试工具,便于用户进行性能与功能测试。
ServiceStack.Redis-4.5.0.0(无限次数版本+测试程序)附带 测试程序 有代码
使用 ServiceStack.Redis 的时候如果需要设置密码,请参考以下格式:
- 对于无密码的连接:`ip:port`
- 对于带有密码的连接:`password@ip:port`
例如,如果你有一个 Redis 主机地址为 `123456@127.0.0.1:6379` 的配置,则可以按照以下方式设置:
```csharp
var redisHostStr = 123456@127.0.0.1:6379;
if (!string.IsNullOrEmpty(redisHostStr))
{
string[] redisHosts = redisHostStr.Split(,);
if (redisHosts.Length > 0)
{
pool = new PooledRedisClientManager(redisHosts, redisHosts,
new RedisClientManagerConfig()
{
MaxWritePoolSize = RedisMaxWritePool,
MaxReadPoolSize = RedisMaxReadPool,
AutoStart = true
});
}
}
```
这是设置带有密码的连接示例。请根据实际需要调整代码中的 `RedisMaxWritePool` 和 `RedisMaxReadPool` 的值。