Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTP Client with Winsock Control

0 views
Skip to first unread message

Zhao Jiangbin

unread,
Nov 3, 1997, 3:00:00 AM11/3/97
to

I'm trying to write a FTP client program by VB5.0. It's very simple: logs
into a private server, changes to certain directory and lists files under
that directory, gets wanted file.

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

zh...@ssa.com.cn


Daniel Childs

unread,
Nov 18, 1997, 3:00:00 AM11/18/97
to

You need the newest version of the control. They fixed a problem with
the Bind command in the new version.

--
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 ...

0 new messages