Starting a new process on the .NET Framework
To run another program from a .NET program, call the System.Diagnostics.Process.Start method. An example C# program is:
using System.Diagnostics;
class RunNewProcessTest
{
static void Main()
{
Process.Start("notepad");
}
}
In the example, Notepad will be invoked.
A document can be given to the start method (for example “c:\test.txt”). If there is an associated application for the file, the application will launch. Else an exception will be thrown.
If any arguments must be given to the invoked process, put it in the second argument of the Start method. An example is:
Process.Start("notepad", "c:\\test.txt");
(Note: backslash (’\') must be escaped)
In this regard, the Process.Start method is different from C or C++’s system function (defined on stdlib.h (C) or cstdlib (C++)), which would be:
system("notepad c:\\test.txt");










