使用C#获取进程的描述

时间:2013-12-23 08:51:27

标签: c# process

我想使用c#访问windows运行过程的描述。任何人都可以告诉我它是如何可能的

Process[] processlist = Process.GetProcesses();
foreach (Process theprocess in processlist)
{
    label1.Text += theprocess.ProcessName+"\n";
}

我从这段代码中获取了processname。但我也想要描述。请告诉我怎么做呢

1 个答案:

答案 0 :(得分:1)

这应该有效:FileVersionInfo Class

Process[] processlist = Process.GetProcesses();
foreach (Process theprocess in processlist)
{
    label1.Text += theprocess.MainModule.FileVersionInfo.FileDescription + "\n";
}

您可以获得更多属性:

Properties