C# aspx文件下载
来源:互联网 发布:淘宝 云客服 工资 编辑:程序博客网 时间:2024/04/30 08:29
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.IO;public partial class DownloadFiles : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } /// /// 文件下载 /// /// 文件的完整路径 private void FileDownload(string FullFileName) { // 设置保存文件格式(example: *.xls): //Response.ContentType = "application/ms-excel"; 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(); } protected void ButDownload1_Click(object sender, EventArgs e) { FileDownload(@"D:/DownloadFile/水电表资料汇编.rar"); } protected void ButCancel_Click(object sender, EventArgs e) { Response.Redirect("Main.aspx"); }}
- C# aspx文件下载
- C# aspx 下载excel文件
- c# aspx 导出Excel文件的方法
- C#遍历磁盘感染aspx文件
- aspx 文件上传和下载,多文件上传
- ASPX文件
- C#下载文件函数
- c#文件下载问题
- C#文件下载
- c#文件下载
- c#文件下载方法
- c#实现文件下载
- c#下载文件
- c#文件下载,收藏
- c#下载文件代码
- C#下载文件:WebClient
- C# 下载文件
- C# 文件下载
- 中兴V880自带收音机没有外放功能
- 学期结束时
- 利用Python写的二分法查找算法及测试
- [Nosql]MongoDb+Spring [undone]java.lang.NoClassDefFoundError: org/springframework/data/mapping/context/MappingContextAware
- 存储过程中使用事务
- C# aspx文件下载
- How should I run fsck on a Linux file system
- 找到牛股有两大精要方法
- C# 控制台 字符串 左右 移动
- 宽字符和UTF8之间的转换
- 正则基础之——非捕获组
- 键盘各键及对应编码
- 多种发动机,手枪的机械原理图 动画图解
- 登陆Oracle10g控制台时显示“Io 异常:Unknown host specified”