Exemplo n.º 1
0
        /// <summary>
        /// 更新数据库链接
        /// </summary>
        private void UpdateConstr()
        {
            string constr = ((dynamic)ActionParama.Arg).cs;

            if (!IsNotEmptyString(constr))
            {
                Outmsg("参数无效");
                return;
            }

            var model = new KeyValue {
                key = KeyCenter.DBKey, value = constr
            };
            var result = BufHelp.ProtoBufSerialize <KeyValue>(model, KeyCenter.DBConfigFile);

            if (result)
            {
                CacheUtil.Clear();                                                              //清空所有缓存
            }
            Outmsg(result, outmsg: "修改链接字符串出错");
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CacheUtil.Clear();
 }
Exemplo n.º 3
0
 public ActionResult OutLogin()
 {
     CacheUtil.Clear();
     return(Content("Login"));
 }
 /// <summary>
 /// 清除指定key的MemoryCache缓存数据
 /// </summary>
 /// <param name="key">缓存键key</param>
 public static void Clear(string key)
 {
     CacheUtil.Clear(key);
 }