public string SetZSet(string key, string value) { string result = "success"; try { DoRedisZSet rz = new DoRedisZSet(); rz.AddItemToSortedSet(key, value); } catch (Exception ex) { result = ex.Message; } return(result); }
public string GetZSet(string key) { string result = ""; try { DoRedisZSet rz = new DoRedisZSet(); var zSetStr = rz.GetAllItemsFromSortedSet(key); if (zSetStr.Count > 0) { result = string.Join(",", zSetStr); } else { result = "无数据"; } } catch (Exception ex) { result = ex.Message; } return(result); }