我做一个下载页面,用Response.Flush()输出内容,当buffer从txt文档读取内容时, Response.Flush()输出带有html代码,doc/ppt/pdf没有问题,代码如下stream.Position = 0;
 byte[] buffer = ModuleUtil.StreamToBytes(stream);Response.Clear();Response.AddHeader("content-type", "application/OCTET-STREAM;");
Response.AddHeader("Content-Disposition", "attachment;filename=" + strFileName);
Response.OutputStream.Write(buffer, 0, buffer.Length);Response.Flush();