Solved

CONNECT FTP VIA VB6

Posted on 2003-11-05
6
2,814 Views
Last Modified: 2013-11-13
I wanna know how i can connect automaticly on my ftp and download multiple files with VB6 ..... and what reference i need !!!

thanks sorry i dont have a lot of points anymore !!!
0
Comment
Question by:dany651
6 Comments
 

Author Comment

by:dany651
ID: 9687404
i have find something like that....


    frmMain.ftp.RequestTimeout = "60"
    frmMain.ftp.URL = "ftp://216.113.107.19"
    frmMain.ftp.Protocol = "2"
    frmMain.ftp.RemotePort = "21"
    frmMain.ftp.UserName = "yyy"
    frmMain.ftp.Password = "xxx"
    frmMain.ftp.Execute "cd.."
 frmMain.ftp.Execute , "GET /webroot/cdr.zip C:\temp\cdr.zip"
0
 

Author Comment

by:dany651
ID: 9687405
i have find something like that....


    frmMain.ftp.RequestTimeout = "60"
    frmMain.ftp.URL = "ftp://216.113.107.19"
    frmMain.ftp.Protocol = "2"
    frmMain.ftp.RemotePort = "21"
    frmMain.ftp.UserName = "yyy"
    frmMain.ftp.Password = "xxx"
    frmMain.ftp.Execute "cd.."
 frmMain.ftp.Execute , "GET /webroot/cdr.zip C:\temp\cdr.zip"
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9687486
ftp is the name of an Internet transfer control that you need to add to your toolbox.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 9

Expert Comment

by:Dang123
ID: 9687569
These will help you with what you can add in the .Execute method.

http://www.nsftools.com/tips/RawFTP.htm

http://www.vbip.com/winsock/winsock_ftp_ref_01.asp

0
 
LVL 14

Expert Comment

by:aelatik
ID: 9687571
This will download all the files with extension .EXE from the server. You can change that ofcourse.
It is important to use the .stillexecuting event because is has to wait till the command finishes :

    Dim BUFFER() As String: Dim ITEM As Variant
    With Inet1
        .URL = "ftp://www.aclassreizen.nl"
        .UserName = "edited"
        .Password = "edited"
        .Execute , "DIR"
        While .StillExecuting: DoEvents: Wend
        BUFFER = Split(.GetChunk(1024, icString), vbCrLf)
        For Each ITEM In BUFFER
            If UCase(Right(ITEM, 4)) = ".EXE" Then
                .Execute , "GET ITEM C:\temp\" & ITEM
                While .StillExecuting: DoEvents: Wend
            End If
        Next
    End With
0
 
LVL 14

Accepted Solution

by:
aelatik earned 50 total points
ID: 9687594
Forget to mention. you nee to put the inet control on your form ( Microsoft INternet COntrols )
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel - Save a copy of work book 13 84
Add a task in Outlook from access 11 39
Visual Studio 2005 text editor 10 38
Added a column screws up code 5 57
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question