janhoye
asked on
Timer/Timed Control While Loop
Hello all,
I have been trying to find a solution for this problem for few days now.
I was wondering if someone in here can lead me to a right direction where I can find a way to do a timed/timer controlled while loop.
I have a Microsoft Web Browser object inside a while loop that calls some site on my server to update data remotley. the problem is the while loop is going so much faster than the internet connection, so it wouldnt update all files.
I have looked into Thread.Sleep method, but it freezes everything.
Any help would be greatly appreciated.
thanks
I have been trying to find a solution for this problem for few days now.
I was wondering if someone in here can lead me to a right direction where I can find a way to do a timed/timer controlled while loop.
I have a Microsoft Web Browser object inside a while loop that calls some site on my server to update data remotley. the problem is the while loop is going so much faster than the internet connection, so it wouldnt update all files.
I have looked into Thread.Sleep method, but it freezes everything.
Any help would be greatly appreciated.
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dont forget than you probably need an application.doevents within your loop....
ASKER
thank you so much.
now, i read enough about NavigateComplete and DocumentComplete.
but i have another challenge. Is there any possible way to have the have a property like navigatecomplete for the webbrowser control?
Appreciate the help!
now, i read enough about NavigateComplete and DocumentComplete.
but i have another challenge. Is there any possible way to have the have a property like navigatecomplete for the webbrowser control?
Appreciate the help!
Pseudo code for my suggestion:
Put all the URLs into a queue object
DocumentComplete handler:
Process the current HTML document
If more URLs
Navigate to the next URL from the queue
Bob
Put all the URLs into a queue object
DocumentComplete handler:
Process the current HTML document
If more URLs
Navigate to the next URL from the queue
Bob
ASKER
Thank you both for the answer.
TheLearnedOne, the solution you gave me at the end actually worked like a charm.
I queued all the URLs into an array and loop through the array under the DocumentComplete event...
very very relieved now :)
thanks again,
mike
TheLearnedOne, the solution you gave me at the end actually worked like a charm.
I queued all the URLs into an array and loop through the array under the DocumentComplete event...
very very relieved now :)
thanks again,
mike