Please visit our sponsor
UNKNOWN '************************************** ' Name: Make Your Own FTP Client ' Description:Make a simple FTP Client t ' hat allows you to read and write to a re ' mote computer ' By: Vikramjit Singh ' ' ' Inputs:The IP address and local file n ' ame , path. ' ' Returns:None ' 'Assumes:Set Project Refrences to MSINET ' .OCX before you run the code Or you could set Project components and check on Microsoft Internet transfer control...then drag the MSINET control onto the form.In that case comment the line 'Dim Inet1 As New InetCtlsObjects.Inet ' 'Side Effects:'******************NOTE*** ' *********** ' This code runs fine on a local intrane ' t... for ALL versions of VB. ' This code has also been tested by me t ' o work on the INTERNET for VB5 ' (SP3). if you have VB5 PLEASE upgrade ' to SP3...to resolve known ' bugs in INET. The code will then run l ' ike a breeze. VB 5 SP3 is FREE ' at http://www.microsoft.com/msdownload ' /vstudio/sp97/vb.asp 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.1698/lngWId.1/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** ' Dim Inet1 As New InetCtlsObjects.Inet Dim FTPHostname As String Dim Response As String Public Sub writefile(pathname As String, filename As String, IPaddress As String) 'note ..your ip addres specified should ' be that of an anonymous FTP Server. 'otherwise use ftp://ftp.microsoft.com k ' ind of syntax FTPLogin FTPHostname = IPaddress Inet1.Execute FTPHostname, "PUT " & pathname & filename & " /" & filename Do While Inet1.StillExecuting DoEvents Loop Exit Sub End Sub Public Sub getfile(pathname As String, filename As String, IPaddress As String) 'note ..your ip addres specified should ' be that of an anonymous FTP Server. 'otherwise use ftp://ftp.microsoft.com k ' ind of syntax FTPLogin FTPHostname = IPaddress Inet1.Execute FTPHostname, "GET " & filename & " " & pathname & filename Do While Inet1.StillExecuting DoEvents Loop Exit Sub End Sub Private Sub FTPLogin() With Inet1 .Password = "Pass" .UserName = "Anonymous" End With End Sub