dim buffer() as byte open app.path & "\" & itmx.subitems(1) & ".xls " for binary as #1 redim buffer(1 to lof(1)) get #1, , buffer close #1 winsock1.senddata buffer 我用上面的代码发送数据,然后用下面代码接受数据,但为什么没收到呢??要是收到那收到文件在哪啊???谢谢,新手 dim gbt() as byte winsock1.getdata gbt, vbbyte text1.text = str(gbt)
发表于:2007-11-06 16:31:211楼 得分:2
收到的数据显示在text1文本框里了,没有落地存成文件。
发表于:2007-11-07 15:30:392楼 得分:6
你没有把受到的文件保存下来 dim nfileno1 as long nfileno1 = freefile open opath for append as #nfileno1 write #nfileno1, text1.text close #nfileno1
dim bytdata() asbytedim f%
f = freefile'随机文件号 strfilename =app.path &"\myexcel.xls"'保存路径redim bytdata(1to bytestotal&)
winsock1.getdata bytdata
open strfilename for binary as #f'二进制打开文件 put #f, 1, bytdata'写入数据 close #f'关闭这个打开的文件