zoukankan      html  css  js  c++  java
  • 缓存

    //当前时间
                string now=DateTime.Now.ToString();
                this.lbl1.Text=now;
                //绝对过期
                if(Cache["now"]==null)
                {
                    Cache.Insert("now",now,null,DateTime.Now.AddSeconds(5),System.Web.Caching.Cache.NoSlidingExpiration);
                    this.lbl2.Text=now;
                }
                else
                {
                    this.lbl2.Text=Cache["now"].ToString();
                }
                //滑动过期
                if(Cache["now2"] == null)
                {
                    Cache.Insert("now2", now, null,System.Web.Caching.Cache.NoAbsoluteExpiration,new TimeSpan(0,0,5));
                    this.lbl3.Text = now;
                }
                else
                {
                    this.lbl3.Text = Cache["now2"].ToString();
                }

  • 相关阅读:
    macOS 修改键盘重复按键延迟
    stdout 与 stderr 区别
    E. 1-Trees and Queries
    Codeforces Round #615 (Div. 3)
    Codeforces Round 613(div 2)
    Codeforces Edu80
    SPOJ
    快读
    《货车运输》题解--最大生成树&倍增
    倍增思想求lca
  • 原文地址:https://www.cnblogs.com/wangtiantian/p/5033078.html
Copyright © 2011-2022 走看看