protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Clear(); //清空无关信息
        Response.Buffer= true; //完成整个响应后再发送
        Response.Charset = "GB2312";//设置输出流的字符集-中文
  Response.AppendHeader("Content-Disposition","attachment;filename=Report.doc");//追加头信息
        Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");//设置输出流的字符集
        Response.ContentType = "application/ms-word ";//输出流的MIME类型
        Response.Write(TextBox1.Text);
        Response.End();//停止输出

相关文章:

  • 2021-09-10
  • 2021-12-04
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-01-17
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-12-16
  • 2021-12-27
相关资源
相似解决方案