예제 #1
0
        public static void Error404(string message)
        {
            Robots _rbt = new Robots();

            System.Text.StringBuilder url = new System.Text.StringBuilder();
            url.Append(ConnStringConfig.GetConfig.UrlHome + "template?");
            url.Append(Cookies.CreateVerifyString());

            string html = _rbt.GetHtml(url.ToString(), "utf-8");

            if (_rbt.IsError)
            {
                System.Web.HttpContext.Current.Response.Write(_rbt.ErrorMsg);
                System.Web.HttpContext.Current.Response.End();
            }
            if (string.IsNullOrEmpty(html))
            {
                System.Web.HttpContext.Current.Response.Write(string.IsNullOrEmpty(message) ? "页面无响应" : message);
                System.Web.HttpContext.Current.Response.End();
            }
            if (!string.IsNullOrEmpty(message))
            {
                html = System.Text.RegularExpressions.Regex.Replace(html, "<h1>.*?</h1>", "<h1>" + message + "</h1>", Utils.GetRegexOptions);
            }
            System.Web.HttpContext.Current.Response.Write(html);
            System.Web.HttpContext.Current.Response.End();
        }
예제 #2
0
        public ActionResult ClearCache()
        {
            //121.41.42.209
            //120.55.186.140
            Session.Clear();
            DoCache cache = new DoCache();

            cache.RemoveCacheAll();
            Robots _rob  = new Robots();
            var    html  = _rob.GetHtml("http://121.41.42.209/EbaoLifeServer/runstate?cmdMode=clearCache");
            var    html2 = _rob.GetHtml("http://120.55.186.140/EbaoLifeServer/runstate?cmdMode=clearCache");

            return(Json(new { text1 = "http://121.41.42.209/EbaoLifeServer/runstate?cmdMode=clearCache", text2 = "http://120.55.186.140/EbaoLifeServer/runstate?cmdMode=clearCache" }, JsonRequestBehavior.AllowGet));
            //var html = _rob.GetHtml("http://115.28.79.0/EbaoLifeServer/runstate?cmdMode=clearCache");
            //var html2 = _rob.GetHtml("http://42.96.154.177/EbaoLifeServer/runstate?cmdMode=clearCache");
            //return Json(new { text1 = "http://115.28.79.0/EbaoLifeServer/runstate?cmdMode=clearCache", text2 = "http://42.96.154.177/EbaoLifeServer/runstate?cmdMode=clearCache" }, JsonRequestBehavior.AllowGet);
            //    Response.Write(html);
            //   Response.Write("<hr/>");
            // Response.Write(html2);
        }