.net开发中用下面的代码输出excel
this.Response.Clear();
this.Response.Buffer = true;
string filename = HttpUtility.UrlEncode(strFJ1MC);
this.Response.ContentType = "application/octet-stream";
this.Response.AddHeader("content-type", "application/x-msdownload;");
this.Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);
this.Response.BinaryWrite(ImgByte);
this.Response.Flush();
this.Response.End();但是点IE打开时报错文件名过长!!怎么办!!在线等
this.Response.Clear();
this.Response.Buffer = true;
string filename = HttpUtility.UrlEncode(strFJ1MC);
this.Response.ContentType = "application/octet-stream";
this.Response.AddHeader("content-type", "application/x-msdownload;");
this.Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);
this.Response.BinaryWrite(ImgByte);
this.Response.Flush();
this.Response.End();但是点IE打开时报错文件名过长!!怎么办!!在线等
Response.AddHeader("content-disposition", "attachment;filename=Temp.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Length", ImgByte.Length.ToString());
Response.BinaryWrite(ImgByte);
Response.Flush();
Response.End();