/* 作者: 季健国 * 创建时间: 2012/7/19 21:47:20 * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; namespace Ant.Service.Common { public interface ICache { /// /// 获取全局应用缓存 /// /// /// object GetApplicationCache(string key); /// /// 设置全局应用缓存 /// /// /// void SetApplicationCache(string key, object obj); /// /// 删除全局应用缓存 /// /// void RemoveApplicationCache(string key); } /// /// 全局应用缓存 /// public class ApplicationCache:ICache { #region ICache 成员 public object GetApplicationCache(string key) { return HttpContext.Current.Application[key]; } public void SetApplicationCache(string key, object obj) { HttpContext.Current.Application.Add(key, obj); } public void RemoveApplicationCache(string key) { HttpContext.Current.Application.Remove(key); } #endregion } }