VB icon

Make Your Own FTP Client

Email
Submitted on: 1/2/2015 4:18:00 AM
By: Vikramjit Singh (from psc cd)  
Level: Not Given
User Rating: By 105 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 2859
 
     Make a simple FTP Client that allows you to read and write to a remote computer
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Make Your Own FTP Client
' Description:Make a simple FTP Client that allows you to read and write to a remote computer
' By: Vikramjit Singh (from psc cd)
'
' Inputs:The IP address and local file name , path.
'
' 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 intranet... for ALL versions of VB.
' This code has also been tested by me to 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 like a breeze. VB 5 SP3 is FREE
' at http://www.microsoft.com/msdownload/vstudio/sp97/vb.asp
'**************************************

' 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 kind 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 kind 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


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.