主题:VB中使用WINSOCK API网络传输
高人指点下,我用这个类文件如何发送二进制文件呀
发送:
Dim dat() As Byte
Open "d:\u.jpg" For Binary As #2
ReDim dat(LOF(2) - 1)
Get #2, , dat
Close #2
text1.text=dat'这里为啥数据不对呀
Server.SendData dat
---------
接收
Dim data() As Byte
ReDim data(bytesTotal)
Client.GetData data
Put #1, , dat
-------------
接收错误呀,[em1]
发送:
Dim dat() As Byte
Open "d:\u.jpg" For Binary As #2
ReDim dat(LOF(2) - 1)
Get #2, , dat
Close #2
text1.text=dat'这里为啥数据不对呀
Server.SendData dat
---------
接收
Dim data() As Byte
ReDim data(bytesTotal)
Client.GetData data
Put #1, , dat
-------------
接收错误呀,[em1]