C# 获取进程详细信息

发布于 2024-10-08 00:14:01 字数 320 浏览 0 评论 0原文

这是我的问题:

例如,假设我运行了 5 个选项卡的 Chrome,这将创建 6 个名为 Chrome.exe 的进程,一个用于 chrome,每个选项卡一个。

现在使用 Process.GetProcessesByName("chrome") 将返回所有 6 个进程。

我如何确定哪一个进程是主要进程?

这是可能的,因为 Process Explorer 就是这样做的: alt text

基本上我想获取主 chrome 进程的句柄,我该怎么做?

here is my problem:

For example, lets say I have Chrome running with 5 tabs, this will create 6 processes called Chrome.exe, one for chrome and one each for the tabs.

Now using Process.GetProcessesByName("chrome") will return all 6 processes.

How can I work out which of the processes is the main one?

It is possible as this is what Process Explorer does:
alt text

Basically I want to get the handle for the master chrome process, how do I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一念一轮回 2024-10-15 00:14:01

这实际上取决于您想要研究/分析的过程。只有进程知道它们内部的行为方式。

在特定的 Chrome 情况下,您可以检查哪一个是其他的父级。

以下是确定进程父进程的链接:如何以托管方式获取.NET中的父进程

It really depends on the process you want to study/analyze. Only processes know how they behave internally.

In the specific Chrome case, you can check which one is the parent of others.

Here is a link to determine a process parent: How to get parent process in .NET in managed way

谁人与我共长歌 2024-10-15 00:14:01
  1. 查看所有“chrome.exe”进程 作为
  2. 所有其他进程的父进程的进程是主要进程
  1. Look at all the "chrome.exe" processes
  2. The one that's the parent of all the others is the main one
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文