/// <summary> /// 删除 like 名称的缓存对象。 /// </summary> /// <param name="likeKey"></param> /// <returns></returns> public static int DelObjFormApplication(string likeKey) { int i = 0; if (SystemConfig.IsBSsystem) { string willDelKeys = ""; foreach (string key in BS_Cash.Keys) { if (key.Contains(likeKey) == false) { continue; } willDelKeys += "@" + key; } string[] strs = willDelKeys.Split('@'); foreach (string s in strs) { if (s == null || s == "") { continue; } BS_Cash.Remove(s); i++; } } else { string willDelKeys = ""; foreach (string key in CS_Cash.Keys) { if (key.Contains(likeKey) == false) { continue; } willDelKeys += "@" + key; } string[] strs = willDelKeys.Split('@'); foreach (string s in strs) { if (s == null || s == "") { continue; } CS_Cash.Remove(s); i++; } } return(i); }
public static void RemoveObj(string key) { BS_Cash.Remove(key); }