Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", HttpUtility.UrlEncode(execlName) + DateTime.Now.ToString("yyyy-MM-dd").Trim() + ".xls")); Response.Clear(); excel.WriteTo(Response.OutputStream); Response.End();
HttpUtility.UrlEncode(execlName) //防文件名乱码