后台http请求
HttpResponse response = HttpContext.Current.Response;
response.Buffer = true;
response.Clear();
response.ClearContent();
response.AddHeader("Content-Disposeition",string.Format(attachment;filename="+HttpUtility.UrlEncode(excelname,Encoding.UTF8).ToString()+".xls",DateTime.Now.ToString("yyyyy")));
response.ContentType = "application/ms-execl";
response.ContentEncoding = System.Text.Encoding.UTF8;
response.Charset="GB2312";
response.BinaryWrite(bytes);
response..Flush();
response.Close();
本文来自博客园,作者:zwbsoft,转载请注明原文链接:https://www.cnblogs.com/zwbsoft/p/16562401.html
电话微信:13514280351