欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

aspnet導出word怎么把標簽對也導出了

林國瑞2年前21瀏覽0評論

aspnet導出word怎么把標簽對也導出了?

//記得不能用ajax 請求 | submit 和服務器按鈕都可以

//sbHtml div 內容

//fileName 導出來后文件名

public static void Export(StringBuilder sbHtml, string fileName)

{

try

{

if (sbHtml.Length > 0)

{

HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";

HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;

HttpContext.Current.Response.Charset = "Utf-8";

HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName + ".docx", System.Text.Encoding.UTF8));

HttpContext.Current.Response.Write(sbHtml.ToString());

HttpContext.Current.Response.End();

}

}

catch (Exception ex)

{

Logger.WriteLog("-----------導出數(shù)據(jù)異常-----------\r\n" + ex.ToString() + "\r\n");

}