Avatar of cashisthepower
cashisthepower
 asked on

VB6.0 INET Do Events ? (500 POINTS EASY QUESTION EXPERTS )

Hello Experts!

When i click the command2 its start connecting to the ftp and getting  a file , i would like when the download it's done then to MSGBOX " DOWNLOAD IS DONE "

my little source ...
-----------------------
Private Sub Command2_Click()
Inetupload.URL = "ftp://ftp.angelfire.com"
    Inetupload.UserName = "punk/hdc"
    Inetupload.Password = "hackingdigitalcrew"
    Inetupload.Execute , "GET test.exe /info.exe"
''''''' I WANT HERE TO STOP UNTIL THE DOWNLOAD IS FINISHED THEN DO EVENTS "
MSGBOX " DOWNLOAD IS DONE "
End Sub
--------------------------
Visual Basic Classic

Avatar of undefined
Last Comment
GrahamSkan

8/22/2022 - Mon
GrahamSkan

Don't wait there.
Just use the inet event:

Option Explicit

Private Sub Command2_Click()
InetUpload.URL = "ftp://ftp.angelfire.com"
    InetUpload.UserName = "punk/hdc"
    InetUpload.Password = "hackingdigitalcrew"
    InetUpload.Execute , "GET test.exe /info.exe"
''''''' I WANT HERE TO STOP UNTIL THE DOWNLOAD IS FINISHED THEN DO EVENTS "
End Sub

Private Sub InetUpload_StateChanged(ByVal State As Integer)
    Debug.Print State
    If State = icResponseReceived Then
        MsgBox " DOWNLOAD IS DONE "
    End If
End Sub
ASKER CERTIFIED SOLUTION
GrahamSkan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes