日期:2014-05-17 浏览次数:20669 次
private static void DownLoadExcel(string path,Page page) { System.IO.FileInfo file = new System.IO.FileInfo(path); page.Response.Clear(); page.Response.Charset = "GB2312"; page.Response.ContentEncoding = System.Text.Encoding.ASCII; //page.Response.ContentEncoding = System.Text.Encoding.UTF8; page.Response.AddHeader("Content-Disposition", "attachment; filename=" + page.Server.UrlEncode(file.Name)); page.Response.AddHeader("Content-Length", file.Length.ToString()); page.Response.ContentType = "application/ms-excel"; page.Response.WriteFile(file.FullName); page.Response.Flush(); page.Response.End(); }