/// <summary> /// 查询 Memcached 中所有的缓存键 /// </summary> /// <returns>Memcached 中所有的缓存键</returns> public static List <string> GetAllKeys() { Dictionary <IPEndPoint, List <int> > slabs = Slabs(); List <string> keys = new List <string>(); slabs.Values.ToList().ForEach(members => { members.ForEach(slab => { ICachedumpOperationResult result = client.Cachedump(slab, 0); if (result.Success && result.HasValue) { keys.AddRange(result.Value.Keys); } }); }); return(keys); }