i need to write a program in c# to collect information about processes running on my computer. I successfuly get the processes’s names and ID using this code:
…
Process[] processlist;
…
foreach (Process theprocess in processlist)
{
Console.WriteLine(theprocess.ProcessName + …)
}
…
But i couldn’t get the version of the processes (like Firefox or Visual Studio).
does anybody know how to get the version of a running process?
thanks a lot!
theProcess.MainModule.FileVersionInfo. But there are one or two exceptions you need to catch.