redis密码验证
redis密码验证
编辑redis.windows-service.conf配置文件
登陆验证代码
/// <summary> /// 创建一个新的redis客户端 /// </summary> /// <param name="AHostName">redis IP地址</param> /// <param name="APort">redis端口</param> /// <param name="ALibName">何种通讯</param> /// <param name="APassword">redis登陆密码</param> /// <returns></returns> function NewClient(AHostName: string = 'localhost'; APort: Word = 6379; ALibName: string = 'indy'; APassword: string = 'yn'): IRedisClient; begin Result := TRedisClient.Create(AHostName, APort, ALibName); try TRedisClient(Result).Connect; if APassword <> '' then Result.AUTH(APassword); //验证redis密码 except Result := nil; raise; end; end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/12294309.html