且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将binaryWrite文件分解为多个块

更新时间:2023-02-09 22:12:21

2006年9月13日星期三09:03:42 -0500,Katie< Dn *** ******@gmail.com写道:
On Wed, 13 Sep 2006 09:03:42 -0500, Katie <Dn*********@gmail.comwrote:




我正在做一个binaryWrite来允许用户下载文件。如果文件太大,则会出现问题

。我的一些文件接近

100 megs。我在msdn上读到,如果数据大于4MB,那么建议将b-b分成多个块
Hi,

I am doing a binaryWrite to allow users to download files. The problem
occurs if the file is too big. Some of the files i have are close to
100 megs. I read on msdn that if the data is greater than 4MB it is
advisable to break it up into multiple chunks



可选的第一个参数到Read()方法将允许你指定读取的最大字节数
。所以你有这个:

The optional first argument to the Read() method will allows you to
specify the maximum number of bytes read. So where you have this:


Response.BinaryWrite BinaryStream.Read
Response.BinaryWrite BinaryStream.Read



你可以把它改成这个以千字节块的形式写入数据:


Dim i

For i = 0 To BinaryStream.Size

Response.BinaryWrite BinaryStream.Read(1000)

下一页


您可以找到所有Stream对象属性的文档和

微软网站上的方法。


流对象属性,方法和事件
http://windowssdk.msdn.microsoft.com ... / ms677486.aspx


-

Justin Piper

Bizco Technologies
http://www.bizco.com/


2006年9月13日星期三09:22:36 -0500, Justin Piper< jp **** @ bi zco.comwrote:
On Wed, 13 Sep 2006 09:22:36 -0500, Justin Piper <jp****@bizco.comwrote:

For i = 0 To BinaryStream.Size
For i = 0 To BinaryStream.Size



哎呀,当然应该阅读,For i = 0 To BinaryStream.Size Step

1000。


-

Justin Piper

Bizco Technologies
http://www.bizco.com/


Justin Piper在2006年9月13日写的

microsoft.public.inetserver.asp.general:
Justin Piper wrote on 13 sep 2006 in
microsoft.public.inetserver.asp.general:

2006年9月13日星期三09:22:36 -0500,Justin Piper< jp **** @ bizco.com>

写道:
On Wed, 13 Sep 2006 09:22:36 -0500, Justin Piper <jp****@bizco.com>
wrote:

>对于i = 0到BinaryStream.Size
> For i = 0 To BinaryStream.Size



哎呀,当然应该读,For i = 0 To BinaryStream.Size

步骤1000。


Whoops, that should of course read, "For i = 0 To BinaryStream.Size
Step 1000".



或:


For i = 0 To BinaryStream.Size / 1000


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)

or:

For i = 0 To BinaryStream.Size/1000

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)