简体   繁体   中英

Parsing web browser data in C# on WP7

I'm developing an application for Windows Phone 7, and am running into an odd problem. I have the following code:

   void webBrowser1_Navigated(object sender,System.Windows.Navigation.NavigationEventArgs e)
   {
    update_goals(e.Uri.OriginalString, webBrowser1.SaveToString());

Which calls a function that examines all the data in webBrowser1.SaveToString(). My problem is, the update_goals function doesn't always correctly parse the data. I've tried debugging, but every time I make a break-point, the code works fine. Also, if I seem to pause at all within the update_goals function (for example; displaying a messageBox), it works as well. Does anybody have an idea at what's causing this behavior? Any help would be much appreciated.

Have you tried putting your update_goals method call in the LoadCompleted event handler :-

http://msdn.microsoft.com/en-us/library/microsoft.phone.controls.webbrowser.loadcompleted(v=vs.92).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM