当前位置: 代码迷 >> ASP.NET >> 下载文本文件时,如何该页的HTML源代码也包括到文本文件后面了
  详细解决方案

下载文本文件时,如何该页的HTML源代码也包括到文本文件后面了

热度:9791   发布时间:2013-02-25 00:00:00.0
下载文本文件时,怎么该页的HTML源代码也包括到文本文件后面了?
源代码如下:          
      Response.Clear();
                Response.ContentEncoding   =   System.Text.Encoding.GetEncoding( "utf-8 ");
                Response.ContentType   =   "application/octet-stream ";
                Response.AddHeader( "Content-Disposition ",   "attachment;   filename= "   +   System.Web.HttpUtility.UrlEncode(filename,   System.Text.Encoding.UTF8));
                Response.Flush();
                Response.WriteFile(filepath);

------解决方案--------------------------------------------------------
………
Response.WriteFile(filepath);
//最后加上一句
Response.End();
  相关解决方案