Some notes on software development... RSS 2.0
# Friday, 14 March 2008

With the full .NET library you can call Application.ProductVersion to get the version number of your running application.
This method is not available for Compact Framework so we have to use reflection to help us interrogate the running assembly.

The info we need is held in the AssemblyName class and which we can populate by calling GetExecutingAssembly static method from the Assembly class in the System.Reflection namespace.
The code:

AssemblyName currentAssemblyName = Assembly.GetExecutingAssembly().GetName();
string version = currentAssemblyName.Version.ToString();
Friday, 14 March 2008 11:54:42 (GMT Standard Time, UTC+00:00)  #    -

Sign In
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2019
Hadrian Phillips

All Content © 2019, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)