VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make Your Own FTP Client

by Vikramjit Singh (4 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (105 Votes)

Make a simple FTP Client that allows you to read and write to a remote computer

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

Rate Make Your Own FTP Client

' 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

Download this snippet    Add to My Saved Code

Make Your Own FTP Client Comments

No comments have been posted about Make Your Own FTP Client. Why not be the first to post a comment about Make Your Own FTP Client.

Post your comment

Subject:
Message:
0/1000 characters