code_junkie

How to define if default browser opens the needed page

Nov 14th, 2011
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Process.Start("http://example.com"); // <-- put your url there.
  2.  
  3. void OpenBrowser(string url)
  4. {
  5. try
  6. {
  7. Mouse.OverrideCursor = Cursors.AppStarting;
  8. Process.Start(url);
  9. }
  10. catch (Exception)
  11. { //swallow: exception is sometimes thrown even though
  12. } // the call completed without error
  13. finally
  14. {
  15. Mouse.OverrideCursor = null;
  16. }
  17. }
Add Comment
Please, Sign In to add comment