简体   繁体   English

如何使用c#.net获取计算机中正在运行的进程的详细信息?

[英]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. 我正在开发一个Windows服务,用于存储当前进程的详细信息。 How do I get the details of process running in system and store that in a file using windows service using c# .NET. 我如何获取在系统中运行的进程详细信息,并使用c#.NET使用Windows服务将其存储在文件中。

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: 流程涉及很多方面,但是您可以从System.Diagnostics.Process对象中获取大部分内容:

Process[] allProcesses = Process.GetProcesses();

( MSDN ) 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. 您可以基于文件句柄/锁获得有关打开哪些文件的一些信息,但即使这样也会受到一定限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在C#中获取单个进程的多个实例详细信息? - How to get multiple instance details of single process in c#? 如何在asp.net mvc C#中使用paypal交易的交易ID获取交易详情? - How to get transaction details using transaction ID of a paypal transaction in asp.net mvc C#? 使用C#.net在Windows中检测进程已在运行 - Detecting a Process is already running in windows using C# .net 如何识别和关闭在文件C#.net上运行的进程 - How to identify and close a process running on a file c# .net 如何使用其名称获取 window 服务的 pid 并检查进程是否在任务管理器中运行? 使用 C# - How to get pid of window service using its name and check if the process is running in task manager or not? using C# c#如何获取AD中Computer的objectguid和objectid - How to get the objectguid and objectsid of Computer in AD using c# c#如何获取有关使用IP地址的计算机的信息 - c# How to get info about a computer using IP address 如何使用C#获取计算机的工作组名称? - How can I get the Workgroup name of a computer using C#? 如何使用 c# 获取有关 mysql 表的所有详细信息? - how to get all details about a mysql table using c#? 如何使用 C# 中的 UserPrincipal 获取 Active Directory 中的地址详细信息 - How to get details of address in Active Directory using UserPrincipal in C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM