111,125
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
string filepath = (string)Session["filepath"];
Response.HeaderEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AddHeader("Content-Type", "application/vnd.ms-word");
Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(filepath));
//Response.ContentType = "application/vnd.ms-excel";// 指定返回的是一个不能被客户端读取的流,必须被下载
Response.WriteFile(filepath); // 把文件流发送到客户端
Response.End();
}