IDictionaryEnumerator em = HttpContext.Current.Cache.GetEnumerator(); while (em.MoveNext()) { if (需要删除的条件) { HttpContext.Current.Cache.Remove(em.Key.ToString()); } }…
对于一些不经常改变却经常被request的数据,我们喜欢将它们缓存在内存.这样用户请求时先到缓存中去取,如果缓存中没有,再去数据库拿,提高响应速度.缓存一般实现在BLL,这样可以与DAL分离,更换数据库源时也无需改变缓存逻辑. ASP.NET中常用的缓存技术有以下几种: 1. A per request cache using HttpContext.Items 2. A session cache using HttpContext.Session 3. An application c…
<!-- 根据主键批量删除 --> <delete id="deleteByKeys"> DELETE FROM product WHERE id in <foreach collection="list" separator="," item="id" open="(" close=")"> #{id} </foreach> </d…
#!/bin/shcd 'home/usrname/'ls cd '/home/usrname/VOC2007/Annotations/' for file in `ls /home/usrname/VOC2007/Annotations/`do echo $file sed -i '/<?xml version="1.0" ?>/d' $filedone echo 'all is ok.'…