没有合适的资源?快使用搜索试试~ 我知道了~
Asp.Net远程断点续传[经典]
4星 · 超过85%的资源 需积分: 9 20 下载量 37 浏览量
2008-08-26
09:59:50
上传
评论
收藏 3KB TXT 举报
温馨提示
试读
3页
史上最精简、最强悍的断点续传例子Asp.Net 附:源代码
资源推荐
资源详情
资源评论
System.IO.Stream iStream = null;
// Buffer to read 10K bytes in chunk:
byte[] buffer = new Byte[10240];
// Length of the file:
int length;
// Total bytes to read:
long dataToRead;
// Identify the file to download including its path.
string filepath = @"E:\software\SQL Server 2000 Personal Edition.ISO";
// Identify the file name.
string filename = System.IO.Path.GetFileName(filepath);
try
{
// Open the file.
iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open,
System.IO.FileAccess.Read,System.IO.FileShare.Read);
Response.Clear();
// Total bytes to read:
dataToRead = iStream.Length;
long p = 0;
if(Request.Headers["Range"]!=null)
{
// Buffer to read 10K bytes in chunk:
byte[] buffer = new Byte[10240];
// Length of the file:
int length;
// Total bytes to read:
long dataToRead;
// Identify the file to download including its path.
string filepath = @"E:\software\SQL Server 2000 Personal Edition.ISO";
// Identify the file name.
string filename = System.IO.Path.GetFileName(filepath);
try
{
// Open the file.
iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open,
System.IO.FileAccess.Read,System.IO.FileShare.Read);
Response.Clear();
// Total bytes to read:
dataToRead = iStream.Length;
long p = 0;
if(Request.Headers["Range"]!=null)
{
资源评论
- szy8561232014-05-11一个txt文件,可以学习。
- bai123love2011-11-01现在工作开发的系统要支持多文件断点上传,所以找个例子来看下。 虽然简单了一点,但还算说到一些了。算是了解基本的实现方式了。
xiangweixing
- 粉丝: 10
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功