public string GetToken() { string token = ""; RedisClient client = new RedisClient("192.168.200.201", 6379); //获取Redis里的第二个数据库 client.ChangeDb(1); //获取Hash类型的数据集合 List<string> A = client.GetHashValues("TokenServiceWHlejuMgmW9S"); //将获取到的值转换为JObject类型 JObject jo = (JObject)JsonConvert.DeserializeObject(A[0].ToString()); token = jo["AccessToken"].ToString(); return token; }