That is OK if you already reference System.Windows (as the Application class is defined in there)
A more generic way is to use reflection:
Code:
using System.Reflection;
...
// There are a few possiblilities here.
// Look at the doc for the Assembly class
Assembly assbly = Assembly.GetExecutingAssembly():
string str = assbly.GetName().Version.ToString();
You also have properties on the version object (major, minor, etc.) which allows you to see each part of the version info.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.