c# - Loading a follow up page into a variable using WebBrowser -


i have below code , want know how make code wait webbrowser load next page after activating submit button:

        webbrowser wb = new webbrowser();         wb.scrollbarsenabled = false;         wb.scripterrorssuppressed = false;         wb.navigate(baseurl+uri);         while (wb.readystate != webbrowserreadystate.complete) { application.doevents(); }         var doctitle1 = wb.documenttitle;         foreach (htmlelement form in wb.document.forms)             form.invokemember("submit");         stream datastream = wb.documentstream;         streamreader reader = new streamreader(datastream);         string responsefromserver = reader.readtoend();         console.writeline(responsefromserver); 

i can hear click sound when activates submit hear when @ end of code. if put break in place, can see wb object has data previous page.

thanks!


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -