I was making an application with an About dialog that shows the version number for the app. Rather than add the version number as static text, I made use of reflection to extract the version number from the assembly. If you are interested in doing the same in your application, you can use the following code to get the version number text.
Regex versionRegex = new Regex("Version=(?\\d\\.\\d\\.\\d\\.\\d)");
String GetVersion()
{
string fullName = (this.GetType().Assembly.FullName).ToString();
Match m = versionRegex.Match(fullName);
if(m.Success)
{
return String.Format("{0}", m.Groups["ver"].Value);
}
else
{
return "";
}
}
CodeProject