“System.Threading.ThreadAbortException: 正在中止线程”问题解决方法

context.Response.End();将当前所有缓冲的输出发送到客户端,停止该页的执行,并引发System.Web.HttpApplication.EndRequest事件。

使用context.Response.End(); 会引发“System.Threading.ThreadAbortException: 正在中止线程”的问题。

使用

1 HttpContext.Current.ApplicationInstance.CompleteRequest();

替换context.Response.End();

即可解决此问题

posted @ 2020-09-23 18:47  来瓶冰镇可乐吧  阅读(1020)  评论(0)    收藏  举报