晨鸟科技

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

System.Web.Caching

[复制链接]
跳转到指定楼层
楼主
发表于 2010-12-29 16:41:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. public void AddItemToCache(Object sender, EventArgs e) {! Z, e' g# z% \" s
  2.     itemRemoved = false;
    , d6 `& `5 h" \/ ^  M, T6 T2 c& W/ ~3 X/ m

  3. ) L0 K0 d+ L* X! q5 y
  4.     onRemove = new CacheItemRemovedCallback(this.RemovedCallback);/ V5 _& }6 Y8 `& A# K+ c2 |  s1 o
  5. 4 I" O0 i9 M4 \- t0 I  V! `9 @& p0 b
  6.     if (Cache["Key1"] == null), w; W: r- \% y6 ^8 v6 H" U  ^/ S, s
  7.       Cache.Add("Key1", "Value 1", null, DateTime.Now.AddSeconds(60), TimeSpan.Zero, CacheItemPriority.High, onRemove);* T2 w5 H1 S- Y" n( I% u
  8. }
复制代码
详见:http://msdn.microsoft.com/zh-cn/ ... b.caching.cache.add(VS.80).aspx
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-19 11:58 , Processed in 6.061756 second(s), 9 queries , Wincache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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