Esempio n. 1
0
        /// <summary>
        /// 根据key来删除缓存
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public override long Delete(params string[] key)
        {
#if DNX451 || NET451
            var url = GetClient();
            url = url + "Delete";
            PostDelData postdata = new PostDelData()
            {
                app = "", key = key
            };
            var r  = Http.HttpPost(url, postdata.ToJson());
            var rd = CommonExtenstion.ToJson <ServerData>(r);
            if (rd.result.IndexOf("sussecc") >= 0)
            {
                return(Convert.ToInt64(rd.data));
            }
            else
            {
                return(0);
            }
#else
            throw new Exception("not support this method");
#endif
        }
Esempio n. 2
0
        /// <summary>
        /// 不带值则删除key对应的缓存
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public override bool Set(string key)
        {
#if DNX451 || NET451
            var url = GetClient();
            url = url + "Delete";
            string[]    keys     = { key };
            PostDelData postdata = new PostDelData()
            {
                app = "", key = keys
            };
            var r  = Http.HttpPost(url, postdata.ToJson());
            var rd = CommonExtenstion.ToJson <ServerData>(r);
            if (rd.result.IndexOf("sussecc") >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
#else
            throw new Exception("not support this method");
#endif
        }