Process Constructor
Collapse the table of content
Expand the table of content

Process Constructor

Initializes a new instance of the Process class.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

public Process()

If you do not specify the MachineName property, the default is the local computer, (".").

You have two options for associating a new Process component with a process on the computer. The first option is to use the constructor to create the Process component, set the appropriate members of the StartInfo property and call Start to associate the Process with a new system process. The second option is to associate the Process with a running system process by using GetProcessById or one of the GetProcesses return values.

If you use a static overload of the Start method to start a new system process, the method creates a new Process component and associates it with the process.

When the ProcessStartInfo.UseShellExecute property is set to its default value, true, you can start applications and documents in a way that is similar to using the Run dialog box of the Windows Start menu. When ProcessStartInfo.UseShellExecute is false, you can start only executables.

Any executable file that you can call from the command line can be started in one of two ways: by setting the appropriate members of the StartInfo property and calling the Start method with no parameters, or by passing the appropriate parameter to the static Start member.

You can create a Process component by using the constructor, one of the static Start overloads, or any of the GetProcessById, GetProcesses, or GetProcessesByName methods. After you have done so, you have a view into the associated process. This is not a dynamic view that updates itself automatically when the process properties have changed in memory. Instead, you must call Refresh for the component to update the Process property information in your application.

  • LinkDemand 

    for full trust for the immediate caller. This member cannot be used by partially trusted code.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0

Community Additions

© 2016 Microsoft