473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to wait for axBroswer DownloadComplete in a loop?

I've a wrapper class around axBrowser which logs into a site,
navigates to a data page and harvests info from it.

It works fine for a single data page (passing it a key for the data),
but my next task is to put it in a loop so that I can retrieve
multiple pages of data.

My problem is that how can I control the loop such that it won't try
and get the next page of data until the previous one has completed -
bearing in mind that I have to wait until the axBrowser has signalled
that its done the download by firing the DownloadComplete event.

I think the logic would be something like this but I'm not sure how to
code this in C#:

1. Create new browser wrapper object (bwo).
2. Get a list of keys for the bwo to harvest data for.
3. Start loop of all keys.
4. Call Navigate2 in bwo to navigate to the correct data page using
the current key.
5. Wait until bwo has signalled that its fired DownloadComplete and
got the data and has returned ok.
6. Jump back to 3 until all keys have been read.
Browser wrapper has the following standard axBrowser methods:
Navigate2 - to go to the desired data page.
DownloadComplete - called when the data page is downloaded - could be
any length of time after Navigate2 called. Fires an event to signal
that we've done this page.

I've an inkling that I'll need to use threading, but I'm not sure how
to go about it and also that the axBroswer in single threaded which
may make it more interesting?

Thanks in advance for any help

Swin
Nov 16 '05 #1
1 1835
BTW: I meant Document Complete not DownloadComplete

swin

news:<81*************************@posting.google.c om>...
I've a wrapper class around axBrowser which logs into a site,
navigates to a data page and harvests info from it.

It works fine for a single data page (passing it a key for the data),
but my next task is to put it in a loop so that I can retrieve
multiple pages of data.

My problem is that how can I control the loop such that it won't try
and get the next page of data until the previous one has completed -
bearing in mind that I have to wait until the axBrowser has signalled
that its done the download by firing the DownloadComplete event.

I think the logic would be something like this but I'm not sure how to
code this in C#:

1. Create new browser wrapper object (bwo).
2. Get a list of keys for the bwo to harvest data for.
3. Start loop of all keys.
4. Call Navigate2 in bwo to navigate to the correct data page using
the current key.
5. Wait until bwo has signalled that its fired DownloadComplete and
got the data and has returned ok.
6. Jump back to 3 until all keys have been read.
Browser wrapper has the following standard axBrowser methods:
Navigate2 - to go to the desired data page.
DownloadComplete - called when the data page is downloaded - could be
any length of time after Navigate2 called. Fires an event to signal
that we've done this page.

I've an inkling that I'll need to use threading, but I'm not sure how
to go about it and also that the axBroswer in single threaded which
may make it more interesting?

Thanks in advance for any help

Swin

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rasmus Grøndahl Olsen | last post by:
I have tried to write a wait function but it seems like it will not brake the while loop. I tried two different solutions. Can anyone tell me what I am doing wrong, and come with another...
6
by: yaron | last post by:
Hi, I wanted to use Monitor.Wait but the millisecondsTimeout parameter is of type int, and also with the TimeSpan param it can't be greater than MaxInt32 milliseconds. What to do ? ...
15
by: Snuyt | last post by:
Hello, I want the program to wait a few seconds between executing code. It should look something like this: public sub xx() ...code... wait(2) 'wait 2 seconds ...code...
4
by: Terry Olsen | last post by:
I have loop that calls a Sub that runs the following code: Dim WinZip As System.Diagnostics.Process Dim args As String = " -Pru -ex " & lblFolder.Text & "\" & PCName & ".zip @""" & appPth &...
11
by: ryan | last post by:
Hi, I've omitted a large chunk of the code for clarity but the loop below is how I'm calling a delegate function asynchronously. After I start the each call I'm incrementing a counter and then...
10
by: IdleBrain | last post by:
Hello all, The sleep() method hangs up the application and does not respond to events. So, I wrote a small delay loop that will allow the application to respond to events. 'Use Delay(500) to...
5
by: GS | last post by:
is there such thing as DownloadComplete for AxSHDocVw.AxWebBrowser? and if there is, what is the name for the event object?
5
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to...
0
by: Davew01 | last post by:
I am trying to detect when a web page has completely downloaded in Internet Explorer to trigger another event in VB.net application to update a textbox with the URL currently shown in the IE address...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.