By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,892 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,892 IT Pros & Developers. It's quick & easy.

Getting the Version of EXE File Using C# .NET

P: n/a
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!!!!!
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
FileVersionInfo myFI = FileVersionInfo.GetVersionInfo("yourexe.exe");

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

Nov 16 '05 #2

P: n/a
THANKS! It works perfectly.
"szeying.tan" <sz*********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
FileVersionInfo myFI = FileVersionInfo.GetVersionInfo("yourexe.exe");

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

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.