Tags: | Categories: Code Snippets Posted by Vitaly Zayko on 11/19/2008 5:40 PM | Comments (0)

If you are familiar with Win32 API then you should know function ShellExecute which performs some operations on files including opening in programs associated with this particular file type.

In .NET Framework world you can use this function through PInvoke but there is a managed mechanism to do the same:

using (System.Diagnostics.Process prc = new System.Diagnostics.Process())
{
   prc.StartInfo.FileName = "c:\\test.txt";
   prc.Start();
}

Enjoy!
Comments are closed