Results 1 to 4 of 4

Thread: web browser control.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    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.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    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
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    Hi thanx for replying Iain17 but that loop in there, just causes my program to freeze up. any other ideas anyone?

  4. #4
    Guest
    Crypt, put a DoEvents before the loop to stop any freezing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width