首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-03-03 
下载文本文件时,怎么该页的HTML源代码也包括到文本文件后面了?源代码如下:Response.Clear()Response.Cont

下载文本文件时,怎么该页的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();

热点排行