代码改变世界

随笔分类 -  [2]Net

CacheStrategy缓存

2013-04-18 11:06 by leo.wl2020, 786 阅读, 收藏, 编辑
摘要: 提高应用服务器性能,针对经常不变内容进行缓存. 1.CacheStrategy: using System; using System.Web.Caching; /// <summary> /// CacheStrategy /// </summary> public class CacheStrategy : ICacheStrat... 阅读全文

MEF 和 MAF

2013-03-15 18:30 by leo.wl2020, 800 阅读, 收藏, 编辑
摘要: 今天在MSDN上看了一下微软这俩个可扩展框架,微软技术高手真很有才! MEF 和 MAF区别: 早期的 .NET Framework 版本引入了 Managed Add-in Framework (MAF),旨在使应用程序能够隔离和管理扩展。 MAF 的重点放在比 MEF 稍高的级别,它集中于扩展隔离以及程序集的加载和卸载,而 MEF 则集中于可发现性、扩展性和可移植性。 这两个框架可以顺利... 阅读全文

Asp.net Mvc中扩展ActionFilterAttribute修改Http Cache Header

2013-03-05 16:06 by leo.wl2020, 772 阅读, 收藏, 编辑
摘要: 在asp.net mvc3中扩展ActionFilterAttribute实现Http Cache Header修改ActionFilterAttribute 是 System.Web.Mvc.ActionFilterAttribute来自于:System.Web.Mvc.dll#region Assembly System.Web.Mvc.dll, v4.0.30319// C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll#endregionusing System;nam 阅读全文

正能量

2013-02-01 14:39 by leo.wl2020, 1046 阅读, 收藏, 编辑
摘要: * 1.01的365次方=37.78343433289 >>>1; * 1的365次方=1; * 0.99的365次方= 0.02551796445229 <<<1; * 1.01=1+0.01,也就是每天进步一点,1.01的365次方也就是说你每天进步一点,一年以后,你将进步很大,远远大于“1”; * 1是指原地踏步,一年以... 阅读全文

.NET中一些常用的基本接口IComparable,IComparer,IEnumerable,IEnumerator,IComparable<T>,IList,ICollection,IQueryable,IDictionary

2012-08-03 16:41 by leo.wl2020, 946 阅读, 收藏, 编辑
摘要: NET中一些常用的基本接口IComparable,IComparer,IEnumerable,IEnumerator,IComparable<T>,IList,ICollection,IQueryable,IDictionary等等,实现自定义类型的foreach ,实现自定义类型的比较,以及索引器等,到MSDN上可以看到大量的资料。 我的代码: using System;using... 阅读全文

AutoWCFService心跳动态加载服务

2012-06-27 10:25 by leo.wl2020, 389 阅读, 收藏, 编辑
摘要: public partial class AutoHostingService : ServiceBase { #region fields private static ServiceDispacher _dispacher; #endregion #region .ctor public AutoHostingService() { InitializeComponent(); InitializeWindsor(); } ... 阅读全文

Log4net简单使用

2012-06-26 21:42 by leo.wl2020, 671 阅读, 收藏, 编辑
摘要: 日志记录:static log4net.ILog _log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)_log.Error(exception);_log.InfoFormat("test:{0}", s.ToString())Log4Net.config:<?xml version="1.0"?> <configuration> <configSections> <se 阅读全文