Created
January 14, 2013 16:23
-
-
Save JeremyMorgan/4531248 to your computer and use it in GitHub Desktop.
This is a way to pop up a web page from a C# Form, either WPF or Winform. It opens a browser to a specific page, perfect for "help" pages or other pages you want to open up with a button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// start a new process | |
Process myProcess = new Process(); | |
try | |
{ | |
// set shell execution | |
myProcess.StartInfo.UseShellExecute = true; | |
// set the url | |
myProcess.StartInfo.FileName = "http://www.mycompany.com/help.htm"; | |
myProcess.Start(); | |
} | |
catch (Exception ex) | |
{ | |
// capture the exception and handle it | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment