When developing a Windows Forms application you sometimes need to open a file using the default program associated with it automatically for the user view or edit it. This could be done by just calling the System.Diagnostics.Process.Start function and passing the file name and path as a string. It works with any file type as long as a default program is assigned to the file extension.

The following example opens a text file and an JPEG image:

System.Diagnostics.Process.Start("C:\Text.txt");
System.Diagnostics.Process.Start("C:\Image.jpg");