FTP using Microsoft Inet in VB 6

Open new Exe Project in Visual Basic 6. Select Component from Project menu. From Component dialog box Select Microsoft Internet Transfer Control 6.0
One new Icon will appear in Tool Box.

Select the tool Inet from Tool Box and place it one the form.

Add one Command Button on the form.

Write following code for the Click event of the Command button.


Dim RemoteFile, LocalFile
RemoteFile = "TestFile.txt" 'Name of file to be fetched from FTP Server
LocalFile = App.Path & "MyFile.txt" 'It will save as MyFile.txt in the
' Folder your application is running

Form1.Inet1.URL = "ftp://FTPURL.com" 'Replace the FTPURL.com with your FTP
'Server URL
Form1.Inet1.UserName = "anonymous" 'User Id to login to FTP Server
Form1.Inet1.Password = "password" 'Password
Form1.Inet1.Execute , "Get " & _
txtRemoteFile & " " & txtLocalFile


Comments

Author: Abhishek Arya25 Apr 2009 Member Level: Gold   Points : 0

that's good.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: