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

Programming TCP/IP (FTP) in Visual Basic 4.0

0 views
Skip to first unread message

GMcKittrick

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to

info...@londonhydro.com (Rob Moore) wrote:

>I am writing a program in visual basic 4.0 and I would like to add an FTP call
>to our mainframe system to retrieve a file.

>Is anyone familiar with how I might do this in Visual Basic. I am using
>Microsoft TCP/IP stack (winsock.dll)

There are several books devoted to programming WinSock plus a number
of VBX and OCX to make life easier.

A quick and dirty approach: use VB to write a text file containing
the ftp commands you would use to retrieve the file, then use
ShellExecute to start the (32-bit console) FTP program that comes with
the MS stack using the text file as input.

HTH
gmc...@erols.com

Rob Moore

unread,
Feb 4, 1997, 3:00:00 AM2/4/97
to

Chris Sacksteder

unread,
Feb 7, 1997, 3:00:00 AM2/7/97
to

gmc...@erols.com (GMcKittrick) wrote:

>info...@londonhydro.com (Rob Moore) wrote:
>>I am writing a program in visual basic 4.0 and I would like to add an FTP call
>>to our mainframe system to retrieve a file.

>A quick and dirty approach: use VB to write a text file containing


>the ftp commands you would use to retrieve the file, then use
>ShellExecute to start the (32-bit console) FTP program that comes with
>the MS stack using the text file as input.

I would suggest this is an elegant or efficient approach, not a q&d one.
(Although I have used DevSoft's FTP control from VB32, and that is a very nice
way to go.)

To expand on McKittrick's suggestion:

(1) open a file and write an FTP script, call it anything (say, ftp.scr):
<userid>
<password>
cd <remote-dir>
lcd <local-dir>
ascii
get <remote.fileid>

(2) use VB's Shell to run ftp, e.g.:

I = Shell("cmd.exe /c ftp -i -s:ftp.scr host.name > ftp.log", 7)

Variations are numerous.

The FTP scripting on NT has improved in recent versions. You can now issue
local commands from the script. For example, I upload a file frequently, and
have to update a text file on that server to indicate the changes. The script
is something like:

<userid>
<password>
cd <remote-dir>
lcd <local-dir>
binary
hash
put <filename.exe>
ascii
lcd ..
get 00-index
!notepad <alocal-dir>\00-index
put 00-index
+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---
Christopher J. Sacksteder, c...@psu.edu
Center for Academic Computing, THE Pennsylvania State University

Ian McLean

unread,
Feb 20, 1997, 3:00:00 AM2/20/97
to

In article <3300a40b.350111273@news> Z.E...@lancaster.ac.uk (Zack Evans) writes:

>On 4 Feb 1997 14:17:35 GMT, info...@londonhydro.com (Rob Moore) wrote:

>>I am writing a program in visual basic 4.0 and I would like to add an FTP call
>>to our mainframe system to retrieve a file.
>>

>>Is anyone familiar with how I might do this in Visual Basic. I am using
>>Microsoft TCP/IP stack (winsock.dll)

>Surely there are now ActiveX controls to do this sort of thing - I'd
>have a look at the ActiveX development area on www.microsoft.com and see
>what you can find. I imagine you can download the resdistributable parts
>of the ActiveX SDK at least.

>Zack

Zack,

Check this out:

http://www.packet.com/packet/garfinkel/96/47/index2a.html

Ian

0 new messages