Program version info

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Hi All,

I need to put the program version info into it's about box. How do I get
the various version number (major, minor, rev, etc, etc)

I have tried this (major part only) but am getting a method was expected
error

strversion = "Version:" +
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileMajorPart();



Thanks
 
Lee said:
Hi All,

I need to put the program version info into it's about box. How do I
get the various version number (major, minor, rev, etc, etc)

Hi. Have a look at:

System.Reflection.Assembly.GetExecutingAssembly().GetName().Version

It returns a System.Version object containing Major, Minor and Revision
properties.
 
Hi All,

I need to put the program version info into it's about box. How do I get
the various version number (major, minor, rev, etc, etc)

I have tried this (major part only) but am getting a method was expected
error

strversion = "Version:" +
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileMajorPart();

Try
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
 
Back
Top