← Interactive API Explorer
Namespace: System.Diagnostics

Process

Provides access to local and remote processes and enables you to start and stop local system processes.

Properties (7)

bool HasExited
Gets a value indicating whether the associated process has been terminated.
Value: true if the operating system process referenced by the Process component has terminated; otherwise, false.
ProcessStartInfo StartInfo
Gets or sets the properties to pass to the Start method of the Process.
Value: The ProcessStartInfo that represents the data with which to start the process. These arguments include the name of the executable file or document used to start the process.
String ProcessName
Gets the name of the process.
Value: The name that the system uses to identify the process to the user.
TimeSpan TotalProcessorTime
Gets the total processor time for this process.
Value: A TimeSpan that indicates the amount of time that the associated process has spent utilizing the CPU. This value is the sum of the UserProcessorTime and the PrivilegedProcessorTime.
StreamReader StandardOutput
Gets a stream used to read the textual output of the application.
Value: A StreamReader that can be used to read the standard output stream of the application.
StreamReader StandardError
Gets a stream used to read the error output of the application.
Value: A StreamReader that can be used to read the standard error stream of the application.
StreamWriter StandardInput
Gets a stream used to write the input of the application.
Value: A StreamWriter that can be used to write the standard input stream of the application.

Methods (4)

Process[] GetProcesses
Creates a new Process component for each process resource on the local computer.
Returns: An array of type Process that represents all the process resources running on the local computer.
bool Start
Starts (or reuses) the process resource that is specified by the StartInfo property of this Process component and associates it with the component.
Returns: true if a process resource is started; false if no new process resource is started (for example, if an existing process is reused).
bool WaitForExit(Int32)
Instructs the Process component to wait the specified number of milliseconds for the associated process to exit.
ParameterDescription
millisecondsThe amount of time, in milliseconds, to wait for the associated process to exit. The maximum is the largest possible value of a 32-bit integer, which represents infinity to the operating system.
Returns: true if the associated process has exited; otherwise, false.
void Kill
Immediately stops the associated process.