简体   繁体   中英

How to get details of running process in a computer using c# .net?

I am developing a windows service that store the details of current processes. How do I get the details of process running in system and store that in a file using windows service using c# .NET.

I am trying to get all the information about a system(computer).

What are the files opened, which website is browsed etc. along with who is the current user.

There are many aspects to a process, but you can get most of them off of the System.Diagnostics.Process object:

Process[] allProcesses = Process.GetProcesses();

( MSDN )

That will get you information on all running processes.

However much of the information you are looking for, such as what website is being browsed, simply isn't available to other processes. You could get some information about which files are open based on file-handles/locks, but even that will be somewhat limited.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM