
.NET Socket vs VB6 Winsock problem!
Hi,
I am using an ordinary VB6 program as a client, and a .NET application as my
Server.
They communicate through winsock/socket with no problems.
Although when sending a ZIP file from VB6 to .NET the file received at the
.NET server is different from the one sent by the VB6 application, and the
ZIP file becomes corrupt.
The funny part is, that when I send a ZIP file from the .NET server to the
VB6 client, then the ZIP is fine.
How should I send the file from VB6? I have tried to use the InputB in order
to send a byte array. But it doesn't help.
Here is the VB6 code that sends the file:
Open Source For Binary Access Read Lock Read As #FreeF
nCnt = 1
LenFile = LOF(FreeF)
Connection.SendData "FileLen=" & LenFile
Connection.SendData "FilePath=" & SaveAs
Dim B() As Byte
ReDim B(1 To LOF(FreeF))
Get #FreeF, , B()
Connection.SendBytes B
Close #FreeF
Thanks,
Michael