ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

ShowWebPage

This extension method trigers the default navigator with the address pointed by the string

Source

public static void ShowWebPage(this string pAddress)
{
   ProcessStartInfo procFormsBuilderStartInfo = new ProcessStartInfo();
   procFormsBuilderStartInfo.FileName = pAddress;
   procFormsBuilderStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
   Process procFormsBuilder = new Process();
   procFormsBuilder.StartInfo = procFormsBuilderStartInfo;
   procFormsBuilder.Start();
}

Example

"http://www.trevoit.com".ShowWebPage();

Author: Fernando Bravo

Submitted on: 15 sep. 2013

Language: C#

Type: System.Diagnostics

Views: 4586