-
Hiyas, I have been playing around with html mail servers,
to check email etc, like Yahoo, I was using the inet control to do
this, login, go to their inbox, extract all new mail etc to
alert them when they had new mail, but for
people on lower than a 56k modem it would time out on them, and it
wouldn't work, now I know a way around this, it involves using the
webbrowser control (it would be hidden on the form), to go to the
urls, I specify, get the html source from the webbrowser control once
the page has loaded, and then extract the info I need from that.
but there is one problem, I want to do it in a loop, because it checks
multiple accounts (I usually have about 8 different accounts on each
server lol), but I don't want to use the webbrowser document complete
event (because I am doing it in a loop and I can't include that in
the loop), but I don't want it to continue onto the next step until
the page had been completely downloaded.
for example:
Code:
Dim i as Integer
For i = 1 to Combo1.Text
Webbrowser1.Navigate "webpage here"
'Do stuff here after page has
'been downloaded.
Next I
but the stuff after webbrowser1.navigate is executed straight after
before the page is downloaded (and before I have extracted the details
needed), is there anyway to not execute the next statement until the
page is downloaded.
thanx for the help.
-
Use the readyState property of the WebBrowser. Loop until it is in the complete state.
Code:
Dim i as Integer
For i = 1 to Combo1.Text
Webbrowser1.Navigate "webpage here"
'loop while the ready state is not complete
Do While WebBrowser1.ReadyState <> READYSTATE_COMPLETE
Loop
'Do stuff here after page has
'been downloaded.
Next I
-
Hi thanx for replying Iain17 but that loop in there, just causes my program to freeze up. any other ideas anyone?
-
Crypt, put a DoEvents before the loop to stop any freezing.