Workbook workbook=new Workbook();
string fileName="文档";
//判断浏览器类型 如果是IE文件名转编码
string curBrowser = HttpContext.Current.Request.Browser.Type.ToLower();
//IE浏览器
if (curBrowser.IndexOf("explorer", StringComparison.Ordinal) >= 0 ||curBrowser.IndexOf("ie", StringComparison.Ordinal) >= 0){
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.AppendHeader("Content-Disposition", string.Format("attachment;filename={0}.xls", HttpUtility.UrlEncode(fileName, Encoding.UTF8)));
HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.BinaryWrite(workbook.SaveToStream().ToArray());
HttpContext.Current.Response.End();
}else{
HttpCont
12-24
937