private void Export(int pageIndex = 0) {
var sb = new StringBuilder(); 。。。 Response.Clear(); Response.Buffer = true; Response.Charset = "UTF-8"; Response.Write("<meta http-equiv=Content-Type content=text/html;charset=UTF-8>"); Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName + ".html", Encoding.UTF8).ToString()); Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); Response.ContentType = "text/html"; Response.Write(sb.ToString()); Response.Flush(); Response.End(); }
标红的那句报错:Exception HttpException The remote host closed the connection The error code is 0x800703E3。
这个页面用桌面浏览器下载文件都很正常IE6-12,MS-Edge,firefox,chrome,opera,safari...,只有android手机浏览器访问时这句报错,我部署到IIS用自己的安卓手机访问,VS在w3wp.exe里打断点,用了chrome和百度浏览器都报错,有可能是什么原因呢?