Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how could i know the version of an another application using c#

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!

like image 358
menachem Avatar asked Oct 26 '09 21:10

menachem


1 Answers

theProcess.MainModule.FileVersionInfo. But there are one or two exceptions you need to catch.

like image 136
Daniel Ives Avatar answered Sep 30 '22 14:09

Daniel Ives