惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
Vercel News
Vercel News
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
C
Check Point Blog
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
博客园_首页
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
Last Week in AI
Last Week in AI
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
V
Visual Studio Blog
小众软件
小众软件

博客园 - joinsky

必须会的十种语言 df 有关程序员的传说 网站标准 asp.net中的DES加密 ASp.net中的定位问题. - joinsky - 博客园 文字的竖排与横排 - joinsky - 博客园 两个常用的存储过程(转) iframe自适应网页内容的高度 - joinsky - 博客园 IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败 javascript中object转换为string 数据库中游标的使用.....用于循环 网页技巧之如何隐藏状态栏里出现的LINK信息 随页面滚动的层(转) 页面过长自动进行分页(转) 自定义组件的执行周期(转) 调用DLL中的方法(转) vs2003问题集锦 HTTP/1.1 500 Internal Server Error 解决方法
asp.net下载代码 - joinsky - 博客园
joinsky · 2006-09-25 · via 博客园 - joinsky

Posted on 2006-09-25 17:33  joinsky  阅读(3362)  评论()    收藏  举报

private void FileDownload(string FullFileName)
  {
   FileInfo DownloadFile = new FileInfo(FullFileName);
   Response.Clear();
   Response.ClearHeaders();
   Response.Buffer = false;
   Response.ContentType ="application/octet-stream";
   Response.AppendHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
            Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
   Response.WriteFile(DownloadFile.FullName);
   Response.Flush();
   Response.End();
  }