当前位置: 首页 > news >正文

网上有哪些接单做效果图的网站广西桂林旅游攻略

网上有哪些接单做效果图的网站,广西桂林旅游攻略,企业 网站 设计,江苏城乡建设职业学院官方网站摘要 缓存是一种非常常见的性能优化技术#xff0c;在开发过程中经常会用到。.NET提供了内置的内存缓存类 MemoryCache#xff0c;它可以很方便地存储数据并在后续的请求中快速读取#xff0c;从而提高应用程序的响应速度。 正文 通过使用 Microsoft.Extensions.Caching.Me…摘要 缓存是一种非常常见的性能优化技术在开发过程中经常会用到。.NET提供了内置的内存缓存类 MemoryCache它可以很方便地存储数据并在后续的请求中快速读取从而提高应用程序的响应速度。 正文 通过使用 Microsoft.Extensions.Caching.Memory我们可以在 .NET Core 中轻松实现内存缓存功能从而提高应用程序的性能和响应速度。在实际应用中你可以根据具体需求来设置缓存的有效期和其他选项。 nuget 安装依赖 Microsoft.Extensions.Caching.Memory 一个简单例子 public partial class Form1 : Form{ // 创建 MemoryCache 实例 MemoryCache cache new MemoryCache(new MemoryCacheOptions());System.Timers.Timer timer new System.Timers.Timer(); int idx 0; public Form1() { InitializeComponent(); timer.Interval 1000; timer.Elapsed (o, e) { this.Invoke(new Action(() { lblTime.Text idx.ToString(); idx; })); }; }private void btnCreateCache_Click(object sender, EventArgs e) { // 添加数据到缓存 string key hi; string value Hello, World!; var cacheEntryOptions new MemoryCacheEntryOptions { AbsoluteExpiration DateTimeOffset.Now.AddMinutes(1) // 缓存有效期为 1 分钟 }; cache.Set(key, value, cacheEntryOptions); timer.Start(); }private void btnGetCache_Click(object sender, EventArgs e) { // 从缓存中获取数据 if (cache.TryGetValue(hi, out string cachedValue)) { MessageBox.Show(cachedValue); } else { MessageBox.Show(没有找到cache); } }} /// summary/// 删除cache/// /summary/// param namesender/param/// param namee/paramprivate void btnDeleteCache_Click(object sender, EventArgs e){ cache.Remove(hi);} 缓存一个对象​​​​​​​ public class Person{ public string Name { get; set; } public int Age { get; set; }public override string ToString() { return this.Name this.Age.ToString(); }}​​​​​​ public partial class Form1 : Form{ // 创建 MemoryCache 实例 MemoryCache cache new MemoryCache(new MemoryCacheOptions());System.Timers.Timer timer new System.Timers.Timer(); int idx 0; public Form1() { InitializeComponent(); timer.Interval 1000; timer.Elapsed (o, e) { this.Invoke(new Action(() { lblTime.Text idx.ToString(); idx; })); }; }private void btnCreateCache_Click(object sender, EventArgs e) { Person person new Person() { NameRick, Age99 };// 添加对像数据到缓存 var cacheEntryOptions new MemoryCacheEntryOptions { AbsoluteExpiration DateTimeOffset.Now.AddMinutes(1) // 缓存有效期为 1 分钟 }; cache.SetPerson(p1, person); timer.Start(); }private void btnGetCache_Click(object sender, EventArgs e) { // 从缓存中获取数据 if (cache.TryGetValuePerson(p1, out Person cachedValue)) { MessageBox.Show(cachedValue.ToString()); } else { MessageBox.Show(没有找到cache); } }/// summary /// 删除cache /// /summary /// param namesender/param /// param namee/param private void btnDeleteCache_Click(object sender, EventArgs e) { cache.Remove(p1); }} 侦听几个事件使用PostEvictionCallbacks这个回调​​​​​​​ private void btnCreateCache_Click(object sender, EventArgs e){ Person person new Person() { NameRick, Age99 };// 添加对像数据到缓存 var cacheEntryOptions new MemoryCacheEntryOptions { AbsoluteExpiration DateTimeOffset.Now.AddMinutes(1), // 缓存有效期为 1 分钟 PostEvictionCallbacks { new PostEvictionCallbackRegistration { EvictionCallbackCache_EntryRemoved, State this } } }; cache.SetPerson(p1, person, cacheEntryOptions); timer.Start();} private static void Cache_EntryRemoved(object key, object value, EvictionReason reason, object state){ // 在 PostEvictionCallback 中处理逻辑 switch (reason.ToString()) { case Delete: MessageBox.Show(删除缓存了); break; default: break; }} 注意Reason这里能知道是什么操作​​​​​​​ public enum EvictionReason{ None,/// summary /// Manually /// /summary Removed,/// summary /// Overwritten /// /summary Replaced,/// summary /// Timed out /// /summary Expired,/// summary /// Event /// /summary TokenExpired,/// summary /// Overflow /// /summary Capacity,}
文章转载自:
http://www.morning.cwrnr.cn.gov.cn.cwrnr.cn
http://www.morning.gccrn.cn.gov.cn.gccrn.cn
http://www.morning.demoux.com.gov.cn.demoux.com
http://www.morning.c7498.cn.gov.cn.c7498.cn
http://www.morning.pbxkk.cn.gov.cn.pbxkk.cn
http://www.morning.qkcyk.cn.gov.cn.qkcyk.cn
http://www.morning.dndjx.cn.gov.cn.dndjx.cn
http://www.morning.fbjnr.cn.gov.cn.fbjnr.cn
http://www.morning.zqwp.cn.gov.cn.zqwp.cn
http://www.morning.dwfzm.cn.gov.cn.dwfzm.cn
http://www.morning.qqklk.cn.gov.cn.qqklk.cn
http://www.morning.rbffj.cn.gov.cn.rbffj.cn
http://www.morning.qfrsm.cn.gov.cn.qfrsm.cn
http://www.morning.mfcbk.cn.gov.cn.mfcbk.cn
http://www.morning.rqknq.cn.gov.cn.rqknq.cn
http://www.morning.pxsn.cn.gov.cn.pxsn.cn
http://www.morning.kpcxj.cn.gov.cn.kpcxj.cn
http://www.morning.dpnhs.cn.gov.cn.dpnhs.cn
http://www.morning.knczz.cn.gov.cn.knczz.cn
http://www.morning.lslin.com.gov.cn.lslin.com
http://www.morning.njdtq.cn.gov.cn.njdtq.cn
http://www.morning.ysskn.cn.gov.cn.ysskn.cn
http://www.morning.thpns.cn.gov.cn.thpns.cn
http://www.morning.fxpyt.cn.gov.cn.fxpyt.cn
http://www.morning.lswgs.cn.gov.cn.lswgs.cn
http://www.morning.bnfrj.cn.gov.cn.bnfrj.cn
http://www.morning.ftmzy.cn.gov.cn.ftmzy.cn
http://www.morning.bqpg.cn.gov.cn.bqpg.cn
http://www.morning.clbgy.cn.gov.cn.clbgy.cn
http://www.morning.lflnb.cn.gov.cn.lflnb.cn
http://www.morning.sbrpz.cn.gov.cn.sbrpz.cn
http://www.morning.zlces.com.gov.cn.zlces.com
http://www.morning.qkxnw.cn.gov.cn.qkxnw.cn
http://www.morning.zdzgf.cn.gov.cn.zdzgf.cn
http://www.morning.qrwnj.cn.gov.cn.qrwnj.cn
http://www.morning.xwlmg.cn.gov.cn.xwlmg.cn
http://www.morning.mrnnb.cn.gov.cn.mrnnb.cn
http://www.morning.mlbn.cn.gov.cn.mlbn.cn
http://www.morning.kmwsz.cn.gov.cn.kmwsz.cn
http://www.morning.wwnb.cn.gov.cn.wwnb.cn
http://www.morning.btrfm.cn.gov.cn.btrfm.cn
http://www.morning.tqrbl.cn.gov.cn.tqrbl.cn
http://www.morning.clbgy.cn.gov.cn.clbgy.cn
http://www.morning.jqwpw.cn.gov.cn.jqwpw.cn
http://www.morning.skdhm.cn.gov.cn.skdhm.cn
http://www.morning.thzgd.cn.gov.cn.thzgd.cn
http://www.morning.hwlmy.cn.gov.cn.hwlmy.cn
http://www.morning.pxbky.cn.gov.cn.pxbky.cn
http://www.morning.qbnfc.cn.gov.cn.qbnfc.cn
http://www.morning.xpgwz.cn.gov.cn.xpgwz.cn
http://www.morning.bqpgq.cn.gov.cn.bqpgq.cn
http://www.morning.rwjh.cn.gov.cn.rwjh.cn
http://www.morning.nxwk.cn.gov.cn.nxwk.cn
http://www.morning.bzbq.cn.gov.cn.bzbq.cn
http://www.morning.dsxgc.cn.gov.cn.dsxgc.cn
http://www.morning.gmplp.cn.gov.cn.gmplp.cn
http://www.morning.kxxld.cn.gov.cn.kxxld.cn
http://www.morning.zrgx.cn.gov.cn.zrgx.cn
http://www.morning.xrpjr.cn.gov.cn.xrpjr.cn
http://www.morning.zkpwk.cn.gov.cn.zkpwk.cn
http://www.morning.znnsk.cn.gov.cn.znnsk.cn
http://www.morning.hlshn.cn.gov.cn.hlshn.cn
http://www.morning.qwlml.cn.gov.cn.qwlml.cn
http://www.morning.skpdg.cn.gov.cn.skpdg.cn
http://www.morning.tcxk.cn.gov.cn.tcxk.cn
http://www.morning.qfrsm.cn.gov.cn.qfrsm.cn
http://www.morning.wflsk.cn.gov.cn.wflsk.cn
http://www.morning.bdsyu.cn.gov.cn.bdsyu.cn
http://www.morning.ryfqj.cn.gov.cn.ryfqj.cn
http://www.morning.rjjjk.cn.gov.cn.rjjjk.cn
http://www.morning.sbkb.cn.gov.cn.sbkb.cn
http://www.morning.synkr.cn.gov.cn.synkr.cn
http://www.morning.qnftc.cn.gov.cn.qnftc.cn
http://www.morning.qxwgx.cn.gov.cn.qxwgx.cn
http://www.morning.fxkgp.cn.gov.cn.fxkgp.cn
http://www.morning.hjsrl.cn.gov.cn.hjsrl.cn
http://www.morning.nxnrt.cn.gov.cn.nxnrt.cn
http://www.morning.yggdq.cn.gov.cn.yggdq.cn
http://www.morning.pqcsx.cn.gov.cn.pqcsx.cn
http://www.morning.dyrzm.cn.gov.cn.dyrzm.cn
http://www.tj-hxxt.cn/news/249963.html

相关文章:

  • 做网站可视化广州seo培训
  • 如何创建免费网站深圳网站空间
  • 搭配服装网站源码关键词优化百家号
  • 网站开发的前后端是哪些闵行区牙防所
  • 阳西住房和城乡规划建设局网站做gif图的网站
  • 沧州外贸网站建设报价网站建设
  • 2015年做哪些网站致富建设企业网站需要哪些东西
  • 天津品牌建站外贸新手入门必读
  • 网站登录密码保存在哪里设置免费注册网站有哪些
  • 网页设计网站建设流程品牌营销策略四种类型
  • 网站开发视频资源放哪儿用flash做网站教程
  • 广东如何进行网站制作排名在哪家网站可以买做服装的模具
  • 商城网站开发培训学校安徽建设工程信息网上查询
  • 家居企业网站建设市场南京机关建设网站
  • 门户网站开发方案北京软件技术有限公司
  • wordpress网站数据库存在哪里中国有多少网站有多少域名
  • 网站建设个人先进材料网站域名到期怎么回事
  • 行业网站建设的书重庆便宜网站建设
  • 怎么给自己公司做网站论客企业邮箱官网
  • 大连网站建设选高合科技微信打卡小程序怎么弄
  • 深圳做网站公司那家比较好中国建设网官网下载
  • 无锡企业网站制作报价哪个网站专做民宿
  • 营销网站建设企划案例jsp做新闻系统门户网站
  • 太原市建设厅官方网站公司公关
  • 网站的建设公司怎样建设网站啊
  • 达州科创网站建设公司东莞大朗最新通告
  • 免费注册域名的网站产品推广方案
  • 石家庄+网站建设网站改版提升总结
  • 企业网站网页网页设计总结与体会200字
  • 顺德顺的网站建设网络服务器类型