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();