Esempio 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: "修改链接字符串出错");
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CacheUtil.Clear();
 }
Esempio 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);
 }