我尝试使用
据我理解,这段代码应该可以捕获并忽略错误,然后继续执行。但是,尽管我已经捕获了异常,但在catch语句的结尾括号处仍然会抛出System.Threading.ThreadAbortException异常。我的问题是,为什么即使我显然已经捕获了它,仍然会收到异常,并且如何修复它以忽略异常?
ExportToHttpResponse
导出Crystal ReportDocument,如下所示:report.ExportToHttpResponse(exportOptions, HttpContext.Current.Response, true, "test");
当我第一次尝试运行它时,我收到了一个 System.Threading.ThreadAbortException
。在阅读关于这是ExportToHttpResponse
已知错误的这个问题后,我尝试实现建议的解决方法,将语句包装在try/catch块中,如下所示:
try
{
report.ExportToHttpResponse(expOptions, HttpContext.Current.Response, true, "test");
}
catch (System.Threading.ThreadAbortException e)
{
}
据我理解,这段代码应该可以捕获并忽略错误,然后继续执行。但是,尽管我已经捕获了异常,但在catch语句的结尾括号处仍然会抛出System.Threading.ThreadAbortException异常。我的问题是,为什么即使我显然已经捕获了它,仍然会收到异常,并且如何修复它以忽略异常?