运行过程中,可能得到的DLL的名字呢? [英] Get DLL names from running process, possible?

查看:192
本文介绍了运行过程中,可能得到的DLL的名字呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一种方式来从正在运行的进程中取得的DLL的名字,对不起,如果我表现不好,虽然我自己

I'm seeking for a way to get DLL names from a running process, sorry if I'm poorly expressing myself though.

我需要连接通过它的名称或PID和检索它的使用,如果可能的话DLL的名称这一过程。

I need to "connect" to this process via it's name or PID and retrieve the DLL names that it's using if that's possible.

问候。

推荐答案

是的,它是可能的。您可以使用过程类。它列出了所有加载的模块模块属性。

Yes it is possible. You can use the Process class. It has a Modules property that lists all the loaded modules.

例如,要列出所有进程和所有模块控制台:

For example, to list all processes and all modules to the console:

Process[] processes = Process.GetProcesses();

foreach(Process process in processes) {
    Console.WriteLine("PID:  " + process.Id);
    Console.WriteLine("Name: " + process.Name);
    Console.WriteLine("Modules:");

    foreach(ProcessModule module in process.Modules) {
        Console.WriteLine(module.FileName);
    }
}



当然你也可以检查 。Process.Id 的PID你想等

有关详细信息,请查看文档,这个类: -

For more information check out the documentation for this class:-

http://msdn.microsoft.com/ EN-US /库/ system.diagnostics.process.aspx

注:此代码可能会生气,对于某些系统进程,你会不会访问权限。

这篇关于运行过程中,可能得到的DLL的名字呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆