I tried MS Internet Transfer control, but failed and I learned that this
control does not work well. So I decide to develop my program by MS Winsock
control.
As per RFC 959, the client should establish control connection with server
from any port (U), and issue data request via this connection, the server
then should try to build data connection with client to this port (U), if no
any other port specified by the client with the PORT command.
So I wrote following statements:
wskcontrol.localport = 0
wskcontrol.connect "1.2.3.4", 21
wskcontrol.senddata "USER username" & vbcrlf & "PASS password" & vbcrlf
' all above do work
wsklistener.localport = wskcontrol.localport
wsklistener.bind .localport, .localip ' VB tells
me "Address in use", why?
wsklistener.listen
My question is why the bind method rises error? And how can I let the FTP
server know the data port my client prefers? Do I have to tell the FTP
server the client's data port explicitly (by PORT command) ?
Who can help me? Thanks very much in advance.
PS: sample code in detail will be very appreciated.
Zhao Jiangbin
--
Lester Russell - [MVP/NT] wrote:
>
> There is a good example of doing an FTP client in VB at the MS support page
> .. it uses WINETAPI
>
> --
> Lester Russell
> Microsoft MVP NT - BackOffice/MCP
> Zhao Jiangbin wrote in message ...