Guest User

Untitled

a guest
Jan 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var th = new Thread(() =>
  2. {
  3. using (var br = new WebBrowser())
  4. {
  5. br.DocumentCompleted += browser_DocumentCompleted;
  6.  
  7. br.ScriptErrorsSuppressed = true;
  8. br.ScrollBarsEnabled = true;
  9. br.AllowNavigation = true;
  10.  
  11. br.Navigate(urltoRun);
  12. Application.Run();
  13. }
  14. });
  15. th.SetApartmentState(ApartmentState.STA);
  16. th.Start();
  17. th.Join(60000);
  18. th = null;
  19.  
  20. private void browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  21. {
  22. if (!string.IsNullOrEmpty(htmlResult))
  23. return;
  24. // DO SOMETHING...
  25. }
Add Comment
Please, Sign In to add comment