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
Printable View
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
heres a solution for all interested.
StephanCode:using System.Reflection;
Assembly assembly = Assembly.GetCallingAssembly();
AssemblyName assemblyname = assembly.GetName();
Version assemblyver = assemblyname.Version;
txtResutl.text = assemblyver.toString();
you could always do this ...
VB Code:
MessageBox.Show(System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString());
and i'm not to sure what the Environment.Version is , but ...
:)VB Code:
MessageBox.Show(Environment.Version.ToString());
you can also do this.....
:)VB Code:
MessageBox.Show(System.Environment.CommandLine.GetType().Assembly.GetName().Version.ToString());