c# - WebBrowser Url to string not work -


when code reaches messagebox.show() throws exception object reference not set instance of object.

here code:

webbrowser webb = new webbrowser();     webb.navigate("https://www.facebook.com/logout.php?next=http://facebook.com&access_token=" + settings.default["token"].tostring());  messagebox.show(webb.url.absoluteuri.tostring()); 

do see reason why might case ?

this might work:

webbrowser webb = new webbrowser();  private void picturebox3_click(object sender, eventargs e) {             webb.url = new uri("https://www.facebook.com/logout.php?next=http://facebook.com&access_token=" + settings.default["token"].tostring());     webb.documentcompleted += new system.windows.forms.webbrowserdocumentcompletedeventhandler(this.webbrowser1_documentcompleted);         }  private void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) {     messagebox.show(webb.url.absoluteuri.tostring()); } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -