Process

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:20 AM on 8/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

30 Terms

1
New cards

Process

A class in the System.Diagnostics namespace that represents and provides access to operating-system processes, allowing C# programs to start, inspect, monitor, wait for, and control processes. Domain: C# → .NET → System.Diagnostics → Operating-System Process Management

2
New cards

Process process = new Process();

Creates a new Process component that can later be associated with or used to start an operating-system process.

3
New cards

Process process = Process.Start("notepad.exe");

Starts the specified application or process and returns a Process object representing the started process when available.

4
New cards

Process process = Process.GetCurrentProcess();

Gets a Process object representing the process in which the current .NET application is running.

5
New cards

Process process = Process.GetProcessById(processId);

Gets the local operating-system process having the specified process ID.

6
New cards

Process[] processes = Process.GetProcesses();

Gets an array containing the processes currently running on the local computer.

7
New cards

Process[] processes = Process.GetProcessesByName("notepad");

Gets the running local processes whose process name matches the specified name.

8
New cards

int id = process.Id;

Gets the unique operating-system process identifier associated with the process.

9
New cards

string name = process.ProcessName;

Gets the name of the process.

10
New cards

DateTime started = process.StartTime;

Gets the date and time at which the associated process started.

11
New cards

TimeSpan cpuTime = process.TotalProcessorTime;

Gets the total processor time consumed by the process.

12
New cards

TimeSpan userTime = process.UserProcessorTime;

Gets the amount of processor time the process has spent executing application-level code in user mode.

13
New cards

TimeSpan privilegedTime = process.PrivilegedProcessorTime;

Gets the amount of processor time the process has spent executing operating-system code in privileged mode.

14
New cards

long memory = process.WorkingSet64;

Gets the amount of physical memory currently associated with the process's working set, expressed in bytes.

15
New cards

long peakMemory = process.PeakWorkingSet64;

Gets the maximum amount of physical working-set memory used by the process during its lifetime, expressed in bytes.

16
New cards

ProcessPriorityClass priority = process.PriorityClass;

Gets the operating-system scheduling priority category associated with the process.

17
New cards

process.PriorityClass = ProcessPriorityClass.High;

Requests that the process use the High scheduling priority class; changing process priority may require appropriate permissions and should be done carefully.

18
New cards

bool finished = process.HasExited;

Gets whether the associated process has terminated.

19
New cards

int code = process.ExitCode;

Gets the value returned when the process terminated; it should be accessed only after the process has exited.

20
New cards

DateTime ended = process.ExitTime;

Gets the time at which the associated process terminated and is available after the process has exited.

21
New cards

process.WaitForExit();

Blocks the current thread until the associated process terminates.

22
New cards

bool exited = process.WaitForExit(5000);

Waits up to 5000 milliseconds for the process to terminate and returns whether it exited within that period.

23
New cards

await process.WaitForExitAsync();

Asynchronously waits for the associated process to terminate without synchronously blocking the calling thread while waiting.

24
New cards

process.Kill();

Forcibly terminates the associated process; this should generally be reserved for situations where normal termination is not possible or appropriate.

25
New cards

process.Kill(entireProcessTree: true);

Requests termination of the associated process and its descendant processes.

26
New cards

process.CloseMainWindow();

Requests that a process with a graphical main window close normally by sending a close request to that window.

27
New cards

process.Refresh();

Discards cached process information so subsequently accessed process properties can retrieve updated values.

28
New cards

process.Exited += Process_Exited;

Registers an event handler that can run when the associated process terminates.

29
New cards

process.EnableRaisingEvents = true;

Enables the Process component to raise its Exited event when the associated operating-system process terminates.

30
New cards

process.Dispose();

Releases resources used by the Process component; disposing the Process object does not itself terminate the operating-system process it represents.