1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Web;
- using CB.Cache;
- namespace CB.Web.Kjh.WebServices
- {
- /// <summary>
- /// HandlerFun 的摘要说明
- /// </summary>
- public class HandlerFun : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/html";
- string action = context.Request.QueryString["action"].ToString().Trim();
- string cachekey = context.Request.QueryString["cachekey"].ToString().Trim();
- switch (action)
- {
- case "removecache":
- RemoveCache(context, cachekey);
- break;
- }
- }
- /// <summary>
- /// 清空缓存
- /// </summary>
- /// <param name="context"></param>
- /// <param name="cachekey"></param>
- private void RemoveCache(HttpContext context, string cachekey)
- {
- if (!string.IsNullOrEmpty(cachekey))
- {
- CBCache.GetCacheService().RemoveObject(cachekey);
- }
- context.Response.Write("success");
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
|