2013-12-23 40 views
-1

我想访问使用c#运行Windows进程的描述。有人可以告诉我怎么可能获取使用C#的进程描述

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

我从这段代码中获取processname。但我也想要描述。请告诉我,我怎么能做到这一点

+2

你尝试搜索? –

回答

1

这应该工作:FileVersionInfo Class

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

,您可以得到更多的属性:

Properties

+0

访问被拒绝错误 –