晨鸟科技

 找回密码
 注册
搜索
查看: 8796|回复: 0
打印 上一主题 下一主题

System.Web.Caching

[复制链接]
跳转到指定楼层
楼主
发表于 2010-12-29 16:41:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. public void AddItemToCache(Object sender, EventArgs e) {  m& J3 G: O6 B2 I
  2.     itemRemoved = false;
    3 g8 F/ j2 i" p1 {% M* D
  3. 4 q! B$ Y- O1 U" {$ g8 S
  4.     onRemove = new CacheItemRemovedCallback(this.RemovedCallback);: A8 X+ R7 F  f7 X

  5. / E* x) ?# J" s! ?  u$ k  I) S, W
  6.     if (Cache["Key1"] == null)
    - g8 n6 t, G( f% |4 x4 \- W% G
  7.       Cache.Add("Key1", "Value 1", null, DateTime.Now.AddSeconds(60), TimeSpan.Zero, CacheItemPriority.High, onRemove);- Y  M6 j, R! Q3 P$ Z
  8. }
复制代码
详见:http://msdn.microsoft.com/zh-cn/ ... b.caching.cache.add(VS.80).aspx
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|晨鸟科技 ( 沪ICP备09012675号 )

GMT+8, 2026-3-14 19:27 , Processed in 6.060779 second(s), 8 queries , Wincache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表