qiushuixizhao

1.后台代码:

 string nowtime = DateTime.Now.ToString("yyyy-MM-dd");
            Response.Clear();
            Response.Buffer = true;
            Response.Charset = "GB2312";
            Response.AppendHeader("Content-Disposition", "attachment;filename="+nowtime+".doc");
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");//设置输出流为简体中文
            Response.ContentType = "application/ms-word";//设置输出文件类型为word文件。

2.前台代码:

<%--<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>--%>
<%--<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">--%>

 

分类:

技术点:

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2021-09-14
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
相关资源
相似解决方案