Hi,
I have built an application that is doing some automation. The application contains a main form and several workers threads that gather data using HttpWebRequests - Everything works great.
There is only task that is requiring the use of the WebBrowser object. Since I need to simulate some keystrokes and do a few other tasks that are a little bit tricky, I have decided to place a hidden webbrowser on the form and define the task as follows:
1. A worker thread will be created.
2. A short method will call the WebBrowser.navigate method with a URL of the first page that needs to be loaded.
3. Once loading is completed, the DocumentText of the WebBrowser1 will be sent to the worker thread for processing with can take a few minutes.
4. Once the thread will complete the processing, it will signal the main thread. The main thread will load the next page and go back to step2.
5. Once all pages will be processed, the worker thread will get disposed.
I do not want to create a new thread every time I need to process the data I got from the WebBroser. What is the best way to do it?
Thanks,
Joe
I have built an application that is doing some automation. The application contains a main form and several workers threads that gather data using HttpWebRequests - Everything works great.
There is only task that is requiring the use of the WebBrowser object. Since I need to simulate some keystrokes and do a few other tasks that are a little bit tricky, I have decided to place a hidden webbrowser on the form and define the task as follows:
1. A worker thread will be created.
2. A short method will call the WebBrowser.navigate method with a URL of the first page that needs to be loaded.
3. Once loading is completed, the DocumentText of the WebBrowser1 will be sent to the worker thread for processing with can take a few minutes.
4. Once the thread will complete the processing, it will signal the main thread. The main thread will load the next page and go back to step2.
5. Once all pages will be processed, the worker thread will get disposed.
I do not want to create a new thread every time I need to process the data I got from the WebBroser. What is the best way to do it?
Thanks,
Joe