4 ways to enumerate processes on Windows with C# .NET
December 23, 2015 Leave a comment
A Process object in the System.Diagnostics namespace refers to an operating-system process. This object is the entry point into enumerating the processes currently running on the OS.
This is how you can find the currently active process:
Process current = Process.GetCurrentProcess(); Console.WriteLine(current);
…which will yield the name of the process running this short test code.
It’s probably very rare that you’ll use the above method for anything as it’s not too useful.