Getting exe version info

  • Thread starter Thread starter g18c
  • Start date Start date
G

g18c

Hi, have a real simple question but i cant find the answer in the
docs... i would like to get my c# exe's version info so i can display
on a splash screen and in the about box.

i have looked at stuff on assembilies and reflection but cant make much
headway with it. Any help much appreciated.

Cheers,

Chris
 
Chris,
Assembly.GetExecutingAssembly().GetName().Version.ToString()

Jason Newell, MCAD
Software Engineer
 
Chris,

Assuming your executable is the entry point for the application, you can
easily get the assembly, then the version, like this:

// Get the entry point.
Assembly entryPoint = Assembly.GetEntryAssembly();

// Get the name of the assembly.
AssemblyName entryPointName = entryPoint.GetName();

// Get the version.
Version entryPointVersion = entryPointName.Version;

Then you can do what you wish with the version.

Hope this helps.
 
Back
Top