我是靠谱客的博主 淡然小蝴蝶,这篇文章主要介绍redis 存储字符串多双引号 问题【解决】,现在分享给大家,希望可以做个参考。

直接按字符串方式取出,则会多了一对双引号(" "),查了些资料,有人说是编码问题,但是我没有找到。如果有人知道的,请留言告知一下,谢谢。

public static string GetValueString(string key)
{
using (IRedisClient redis = PooleClient.GetClient())
{
return redis.GetValue(key);
}
}

解决方法:把GetValue换成泛型string,解决此问题。

public static string GetValueString(string key)
{
using (IRedisClient redis = PooleClient.GetClient())
{
return redis.Get<string>(key);
}
}

 

最后

以上就是淡然小蝴蝶最近收集整理的关于redis 存储字符串多双引号 问题【解决】的全部内容,更多相关redis内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(111)

评论列表共有 0 条评论

立即
投稿
返回
顶部