ASP.NET Thread was being aborted 分析与解决

ASP.NET Thread was being aborted 分析与解决

    public class Handler1 : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            Back(context, "success", "ok.");
        }

        /// <summary>
        /// 返回处理信息
        /// </summary>
        /// <param name="status"></param>
        /// <param name="status"></param>
        /// <param name="message"></param>
        private void Back(HttpContext context, string status, string message)
        {
            string retVal = "";
            retVal = "{\"status\":\"" + status + "\",\"message\":\"" + message + "\"}";
            context.Response.ContentType = "application/json";
            context.Response.Write(retVal);
            // context.Response.End(); 在VS2012 13 15 中会出现异常,注释掉就可以了
            return;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }


热门推荐