PDA

Click to See Complete Forum and Search --> : How to get the version of my App? **SOLVED**


Sgt-Peppa
Aug 8th, 2003, 03:53 AM
Hey, i have a small app and I want to get the version of my Application through code. I know its stored in AssemblyInfo. But how to extract it from there? Is there something that equals the app variable from VB?

Thanx, Stephan

Sgt-Peppa
Aug 8th, 2003, 04:13 AM
heres a solution for all interested.


using System.Reflection;
Assembly assembly = Assembly.GetCallingAssembly();
AssemblyName assemblyname = assembly.GetName();
Version assemblyver = assemblyname.Version;
txtResutl.text = assemblyver.toString();


Stephan

dynamic_sysop
Aug 8th, 2003, 04:52 AM
you could always do this ...

MessageBox.Show(System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString());


and i'm not to sure what the Environment.Version is , but ...

MessageBox.Show(Environment.Version.ToString());
:)

dynamic_sysop
Aug 8th, 2003, 05:04 AM
you can also do this.....

MessageBox.Show(System.Environment.CommandLine.GetType().Assembly.GetName().Version.ToString());
:)