dim length as long
dim a(0 to 1) as byte
dim strFile as string
strFile=app.path+"dcp\ywg.dbf"
open strFile for binary as #1
seek #1,8 '可以不要
get #1,8,a(0) '度第八个字节
get #1,9,a(1)
length=(a(1)+1)*256+a(0)
a(0)=0
a(1)=0
put #1,4,a(0) '写到第四个字节
put #1,5,a(1) '写到第五个字节
'====
close
dim a(0 to 1) as byte
dim strFile as string
strFile=app.path+"dcp\ywg.dbf"
open strFile for binary as #1
seek #1,8 '可以不要
get #1,8,a(0) '度第八个字节
get #1,9,a(1)
length=(a(1)+1)*256+a(0)
a(0)=0
a(1)=0
put #1,4,a(0) '写到第四个字节
put #1,5,a(1) '写到第五个字节
'====
close
让文件长度,变为LEN,后部分不要了。
怎么实现?
open strFile+"1" for binary as #2
dim data as byte
for i=1 to length
get #1,i,data '杜
put #2,i,data '写
next iclose
'最后还有一个文件重命名的小问题,
'就是把 strFile+"1" 改为你索要的就行
'这个容易,自己搞把