file version

  • Thread starter Thread starter Panhuber Astrid - PA
  • Start date Start date
P

Panhuber Astrid - PA

Hi!

I'm writing a C# application for PPC2003 and I want to get the file
information (especially Product Number) of some other files (.exe, .cpl and
..dll; some of them written in eVC, some use compact framework).

On the PC I use
FileVersionInfo verInfo = FileVersionInfo.GetVersionInfo(<filename>);

but FileVersionInfo is not available for CF. How can I read the file version
of a file in .net CF ?

thanks in advance,
astrid
 
Hi Panhuber,

Not easily. You can search VS Help with the .NET Compact Framework filter
for "GetFileVersionInfo" and you will find a tutorial using unsafe code
blocks and P/Invokes. The problem with this sample is that it is up to the
OEM to provide this functionality and it cannot always be guaranteed.
Hopefully some MVP's will have a tricky method for doing it.

To find the version of an Assembly you can use the Reflection as follows:

using System.Reflection;
String ver = Assembly.GetExecutingAssembly().GetName().Version.ToString();

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top