المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# Form Application - WebBrowserControl - DocumentComplete issue



C# Programming
03-17-2010, 05:00 PM
I have a C# 3.5 Windows form application that uses the webbrowser control.

This control is used to navigate through a website, where I have a parsing engine that pulls data off the site and stores it in a file. The customer navigates to the site, presses the "record" button and the parsting starts.

The parser is triggered by the DocumentComplete event. This works very well, but I have seen that this event sometimes does not fire. The customer has to navigate through 500 pages and by the time they get to page 500, we found that we are missing maybe 5-6 of the pages.

We have traced the problem to be that the documentcomplete event is not firing all the time. My debug code indicates that the navigating and havigated events have fired correctly, but not the document complete.

At the end of the 500 page run, I have 500 navigating events, 500 navigated events and a variable number of documentcompelte events, ranging from 490-495. We have not traced it to any single page, but are unable to figure out what is causing this. We even added a sound that beeps when the page loads and have found pages that load in the browser and are viewable, but the sound does not play because the event didn't fire. Any thoughts what might be causing this?