代码如下
Encoding encoding = Encoding.GetEncoding("GB2312");
m_Page.Response.ContentEncoding = encoding;
m_Page.Response.Charset = "gb2312";
m_Page.Response.AddHeader("content-type", "application/x-msdownload");
(https://img-ask.csdn.net/upload/201506/17/1434517229_895786.png)m_Page.Response.ContentType = GetContentType(sFileType.ToLower());
m_Page.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(pFileName, Encoding.UTF8));
m_Page.Response.AddHeader("Content-Length", data.Length.ToString());
m_Page.Response.Clear();
//将文件输出在页面上
m_Page.Response.OutputStream.Write(data, 0, data.Length);
m_Page.Response.End();