option base 0 sub SendFile(byval FileName as string) dim hFile as integer, a() as byte, lLength as long redim a(200-1) hFile = FreeFile() Open FileName for binary access read as #hFile lLength = LOF(hFile) while lLength > 0 if lLength < 200 then redim a(lLength-1) Get #hFile, , a 发送a lLength = lLength-200 wend Close #hFile end subsub ReciveFile(byval FileName as string) dim hFile as integer, a() as byte hFile = FreeFile() Open FileName for binary access write as #hFile while 读取(a) Put #hFile, , a wend Close #hFile end sub
sub SendFile(byval FileName as string)
dim hFile as integer, a() as byte, lLength as long
redim a(200-1)
hFile = FreeFile()
Open FileName for binary access read as #hFile
lLength = LOF(hFile)
while lLength > 0
if lLength < 200 then redim a(lLength-1)
Get #hFile, , a
发送a
lLength = lLength-200
wend
Close #hFile
end subsub ReciveFile(byval FileName as string)
dim hFile as integer, a() as byte
hFile = FreeFile()
Open FileName for binary access write as #hFile
while 读取(a)
Put #hFile, , a
wend
Close #hFile
end sub
VB老鸟
等 级:
=================最后请问一下,如何将字符串,直接转换成字符数组.比如一个字符串"C1~C1010101"直接变换成字符数组数据.
dim a() as byte
a = strconv("C1~C1010101", vbfromunicode)'反过来
dim s as string
s = strconv(a, vbunicode)