晨鸟科技
标题:
System.Web.Caching
[打印本页]
作者:
Star
时间:
2010-12-29 16:41
标题:
System.Web.Caching
public void AddItemToCache(Object sender, EventArgs e) {
4 t9 @! l4 K5 d& u( a- B
itemRemoved = false;
* ?4 N7 M" B: k6 q4 V
2 S4 k, s% t' z, O- J
onRemove = new CacheItemRemovedCallback(this.RemovedCallback);
# [5 G; I: }/ Y, Q1 d& x
* ~' |; @+ G A/ P: f% h3 d6 f
if (Cache["Key1"] == null)
' O Q2 p- F- ~/ B. c% {1 S/ w
Cache.Add("Key1", "Value 1", null, DateTime.Now.AddSeconds(60), TimeSpan.Zero, CacheItemPriority.High, onRemove);
% M6 u( u$ w' `( m4 O5 w) \
}
复制代码
详见:
http://msdn.microsoft.com/zh-cn/ ... b.caching.cache.add
(VS.80).aspx
欢迎光临 晨鸟科技 (http://www.chenniao.com/cprofessor/)
Powered by Discuz! X3.2