用C#实现 查看exe所加载dll列表的功能

时间:2021-05-10 23:25:50
var p = System.Diagnostics. Process.GetProcessesByName("w3wp").First();

List<System.Diagnostics.ProcessModule> modules = new List<System.Diagnostics.ProcessModule>();
foreach (ProcessModule element in p.Modules)
{
    modules.Add(element);
}

modules.Where(m => m.FileName.ToLower().Contains("oracle.dataaccess.dll")).Select(m => new { FileName = m.FileName, Version = m.FileVersionInfo.ProductVersion }).Dump();

查看,exe加载的dll .

将w3wp改为对应的名称即可.