您的位置:首页 > 编程语言 > ASP

Excel 从ASP.NET 服务器下载到 本地

2016-06-07 17:39 519 查看
  System.IO.FileInfo file = newSystem.IO.FileInfo(path2);

                Response.Clear();

                Response.Charset ="GB2312";

                Response.ContentEncoding =System.Text.Encoding.UTF8;

               Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(file.Name));

               Response.AddHeader("Content-Length", file.Length.ToString());

                Response.ContentType ="application/x-bittorrent";

               Response.WriteFile(file.FullName);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c# web asp.net