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

推荐订阅源

WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
B
Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Jina AI
Jina AI
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
L
LangChain Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题

博客园 - 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();
  }