Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created January 14, 2013 16:23
Show Gist options
  • Save JeremyMorgan/4531248 to your computer and use it in GitHub Desktop.
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.
// 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