我想使用c#访问windows运行过程的描述。任何人都可以告诉我它是如何可能的
Process[] processlist = Process.GetProcesses();
foreach (Process theprocess in processlist)
{
label1.Text += theprocess.ProcessName+"\n";
}
我从这段代码中获取了processname。但我也想要描述。请告诉我怎么做呢
答案 0 :(得分:1)
这应该有效:FileVersionInfo Class
Process[] processlist = Process.GetProcesses();
foreach (Process theprocess in processlist)
{
label1.Text += theprocess.MainModule.FileVersionInfo.FileDescription + "\n";
}
您可以获得更多属性: