.Net 使用 MemoryCache 2017-10-25 Develop .Net Develop .Net 程序集System.Runtime.Caching.MemoryCache 代码参见12345678910ObjectCache cache = MemoryCache.Default;string key = "_key";System.Data.DataSet ds = cache[key] as System.Data.DataSet;if(ds == null){ CacheItemPolicy policy = new CacheItemPolicy(); policy.AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(10); cache.Set(key, ds, policy);}return ds