WebApplication/Admin/Models/ClearCache.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication.Admin.Models
{
    public partial class ClearCache : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack) 
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("CacheName");
                dt.Columns.Add("CachePath");
                dt.Columns.Add("CacheType");
                DataRow dr = dt.NewRow();
                dr[0] = "系统参数配置缓存";
                dr[1] = "BaiduMap/ConfigList";
                dr[2] = "string[]";
                dt.Rows.Add(dr);
                dr = dt.NewRow();
                dr[0] = "静态标签缓存";
                dr[1] = "BaiduMap/LabelList";
                dr[2] = "string";
                dt.Rows.Add(dr);
                dr = dt.NewRow();
                dr[0] = "模型配置缓存";
                dr[1] = "BaiduMap/ServiceList";
                dr[2] = "DataTable";
                dt.Rows.Add(dr);
                rp_list.DataSource = dt;
                rp_list.DataBind();
                HttpRuntime.Cache.Remove("configmodel");
                HttpRuntime.Cache.Remove("config");
                //HttpRuntime.Cache["config"] = null;
                BLL.Cache.GZXX_Label bll = new BLL.Cache.GZXX_Label();
                //DataTable cdt = bll.GetDataTable("",1,10000);
                //for (int i = 0; i < cdt.Rows.Count; i++)
                //{
                //    HttpRuntime.Cache.Remove("GZ_" + cdt.Rows[i]["LabelName"].ToString());
                //    HttpRuntime.Cache.Remove("KS_" + cdt.Rows[i]["LabelName"].ToString());
                //    HttpRuntime.Cache.Remove("KS:" + cdt.Rows[i]["LabelName"].ToString());
                //}
                //HttpRuntime.Cache.Remove("domain");
                //HttpRuntime.Cache["domain"] = null;

                IDictionaryEnumerator cacheEnmu = HttpRuntime.Cache.GetEnumerator();
                while (cacheEnmu.MoveNext())
                {
                    HttpRuntime.Cache.Remove(cacheEnmu.Key.ToString());
                }
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('缓存更新成功!', {icon: 1,kin: 'layer-ext-moon',closeBtn: 0 });", true);
            } 
        }
后面还有 2 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。