Getting the Version of EXE File Using C# .NET

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!!!!!
 
S

szeying.tan

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top