1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
-
- 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
- }
- }
|