【Vegas原创】超简单的导出word方法
//get BBS Content
string strSubject = "【" + drpType.SelectedValue.Trim() + "】" + txtTitle.Text.Trim();
StringBuilder sbContent = getMailContent(strSubject);
//print
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=FileName.doc");
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(sbContent.ToString());
Response.End();
string strSubject = "【" + drpType.SelectedValue.Trim() + "】" + txtTitle.Text.Trim();
StringBuilder sbContent = getMailContent(strSubject);
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition", "attachment;filename=FileName.doc");
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(sbContent.ToString());
Response.End();
注意:
ContentEncoding要选择UTF8
喜欢请赞赏一下啦^_^