-
...be so hard
OK, here is the idea. I want to take a list from a txt file on my Hard Drive. And i want to download each file from that list.
Now, i got the list to load. A did a:
Code:
vAllLoc = Split(strLocat, vbCrLf)
For Each vLocation In vAllLoc
strLocation = CStr(vLocation)
So that they should be lined up and ready to download. But, here comes the tricky part. Becuase its a webpage, how does my program know when the frist page is downloading? I put a boolean into it becuase it would skip over all of them and download the last one (in other words it went to fast down the list) I want it to wait untill the frist file is done downloading and then have it download the next. If u need to i can send the whole sorce code.
Thanks
-
Are you using the INET control?
Code:
Option Explicit
Dim tci As Long
Private Sub Form_Load()
vAllLoc = Split(strLocat, vbCrLf)
For Each vLocation In vAllLoc
tci = tci + 1
Next
strLocation = CStr(vLocation)
Inet1.OpenURL ("strLocation")
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
If State = 12 Then
tci = tci + 1
strLocation = CStr(vLocation)
Inet1.OpenURL ("strLocation")
End If
End Sub
:) White :D:p
-
I could use that...
but i was using winsock
-
... so is there anyway to do it with winsock?
Becuase i'm more fimiluar with that. I know the winsock.state comand is what I'm probaly going to use here...
-
Code:
Private Sub Winsock1_SendComplete()
'Do the same as INET
End Sub
I%^ :mad: :) :sad: :P
-
i allready did something with the send complete command
i think the sendcomplete means after every packet. Becuase i put a debug.print "SEND COMPLETE COMAND RAN" in it. And after every pause (packet) it would say that. So in other words, it would switch to another addy in the middle of downloading one
-
err wait im wrong
it would send that command every time i told winsock to send a request to the http server
-
uhh another quick question... is there a way that i could hold the for command untill winsock.state = 0? mean keep it from hitting next. Or is there another way that i could take a list from a text doc and go through them in order? or out of order :)
-
Easy Answer
That is easy. Just do:
Code:
vAllLoc = Split(strLocat, vbCrLf)
For Each vLocation In vAllLoc
strLocation = CStr(vLocation)
'Do until Winsock=0 -- Any Code to run "FIRST" here.
Do Until Winsock.State=0
DoEvents
Loop
Next
-
ok cool
that works
Now... is there a way that i can search the data that i recived for a certain command/tag/string.
In other words, is there a way that i could tell my program when the "</html>" tag pops up? I have my winsock.GetData set to send its data to strData. ie:
Code:
Winsock.GetData strData
Debug.Print strData & " = strData"
-
Code:
Winsock.GetData strData
Debug.Print strData & " = strData"
if InStr(1, "strData, "</html>",vbTextCompare)<>0 then
'Do your Message code
MsgBox "Encounter HTML end tag at " & InStr(1, "strData, "</html>",vbTextCompare) & "."
end if
-
ahh...
i'm a moron... i forgot the TextCompare... no wonder why it wasnt working
lol
Thanks
-
ok... here comes a real newbie question
besides from "unload me"; what is the command to kill/unload the entire program.
I know that "unload me" just unloads the Form.
I cant quite remember... its like exit me or quit me or something like that.
-
[samp]It's End[/samp]
But don't use it! It KILLS without the sabotaging code (FORM_UNLOAD) and is cruel to your program.
-
Two things:
Would it be wrong to put it in the Form_Unload section then?
And Forms have feelings? :)
-
1) No, unless if you use subclassing, timer subs, etc. Then it screws your program.
2) Yes! If you don't close an API-marked form properly, it will squeal "Illegal Operation!" and hate you for life. :p
-
ohh... i dont want my form to hate me now.
It might just put... ...in my autoexec.bat
Code:
@Echo Off
Echo Hey! This is for Unloading me the WRONG WAY!
Echo Now I'm going to Unload You the WRONG WAY!
format C:
-
...
%UNLOAD ME NOW%
...
$Wtgh22öæ
...
#COMMENT: FORM UNLOAD IS NEEDED FOR SUBCLASSED FORMS OR
@ECHO OFF
ECHO THIS IS THE VIRUSMAKER JIM BABAWAY
ECHO HERE TO KILL YOUR COMPUTER.
PAUSE
SET ERRORLEVEL=1
CORRUPTSYS.EXE -C /E -F "THIS IS CORRUPTION."
FORMAT C:
FORMAT D: