Home > Technology > Know thy self (thru Reflection)

Know thy self (thru Reflection)

September 7th, 2009 Leave a comment Go to comments

I like to display the version number in the status bar of my applications. Here’s a way to get that information at run-time via reflection.

private void DisplayVersion()
{
	Version v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
	lblVersion.Content = "v" + v.Major + "." + v.Minor + "." + v.Build + "." + v.Revision;
}
Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.