Getting the Version of EXE File Using C# .NET

  • Thread starter Thread starter kris
  • Start date Start date
K

kris

Hello,
We're porting some old code to our new C# .NET project and are having
trouble getting the file version of a non-.NET EXE file using C# .NET code.

In our old code, we were using the FileSystemObject (specifically the
GetFileVersion method) to easily get the version of the EXE file.

In .NET however, we haven't been able to figure out an equivalent method to
easily get the file version of a non-.NET file.

Does anyone know how to get the file version of a non-.NET EXE file from C#
..NET code?

TIA!!!!!
 
FileVersionInfo myFI = FileVersionInfo.GetVersionInfo("yourexe.exe");

then,
myFI.FileVersion
will give you the version number.
 
Back
Top