我想知道字节数组的用法

powerword 2000-08-29 09:38:00
private sub bintofile(sfilename as string,fld as adodb.field)

dim bbuffer() as byte
dim nlenleft as long
dim schunksize as long

'remove any existing destination file

if len(dir$(sfilename))>0 then
kill sfilename
end if

're-create a new field
open sfilename for binary as #1

'use a 32k initial chuck size
nchunksize = 32768
nlenleft = fld.actulsize
if nlenleft<nchunksize then
nchunksize = nlenleft
end if
'retrieve the binary data in chunks
do
redim bbuffer(nchunksize-1)
bbufer=fld.getchunk(nchunksize) ///这一句对吗?
///bbufer=bbufer+fld.getchunk(nchunksize)
///字节数组有那些操作?请告知
nlenleft=nlenleft-nchunksize
if nlenleft<nchunsize then
nchunksize = nlenleft
end if
loop until nlenleft<=0
'write the data to the file
put #1,,bbuffer
close #1
end sub
...全文
145 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧