From 7f9be85686afe6ed9ac364e6b3539645b834722d Mon Sep 17 00:00:00 2001 From: wangsheng <123456> Date: 星期二, 30 十一月 2021 16:40:35 +0800 Subject: [PATCH] 修复代理商权限问题 --- web/App_Code/WebTool.cs | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/web/App_Code/WebTool.cs b/web/App_Code/WebTool.cs index 06b4a89..e41a476 100644 --- a/web/App_Code/WebTool.cs +++ b/web/App_Code/WebTool.cs @@ -41,12 +41,13 @@ } } - public void Export(DataTable dataTable, Dictionary<string, string> dictionary, string fileName, HttpResponse Response) + public void Export(DataTable dataTable, Dictionary<string, string> dictionary, string fileName, HttpResponse Response) { StringBuilder stringBuilder = new StringBuilder(); - //stringBuilder.Append("<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/>");//鏃х殑-瀵煎嚭xls - stringBuilder.Append("<meta http-equiv=\"content-type\" content=\"vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8\"/>");//瀵煎嚭鏍煎紡xlsx - stringBuilder.AppendLine("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">"); + //stringBuilder.Append("<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/>");//鏃х殑-瀵煎嚭xls + //stringBuilder.Append("<meta http-equiv=\"content-type\" content=\"vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8\"/>");//瀵煎嚭鏍煎紡xlsx + stringBuilder.Append("<meta http-equiv=\"content-type\" content=\"text/csv\"/>");//瀵煎嚭鏍煎紡xlsx + stringBuilder.AppendLine("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">"); stringBuilder.AppendLine("<tr>"); foreach (KeyValuePair<string, string> keyValuePair in dictionary) { @@ -77,8 +78,10 @@ } stringBuilder.AppendLine("</table>"); Response.ClearContent(); - Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ".xlsx"); - Response.ContentType = "application/excel"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".csv"); + Response.ContentType = "text/csv"; + //Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ".xlsx"); + //Response.ContentType = "application/execl"; Response.ContentEncoding = Encoding.UTF8; Response.Write(stringBuilder.ToString()); Response.End(); -- Gitblit v1.9.1