在.NET Compact Framework的应用程序版本号版本号、应用程序、NET、Compact

2023-09-03 13:40:17 作者:纵横小可爱

我需要在屏幕上显示的.NET Compact Framework的版本号。我使用.NET CF 2.0与Windows  CE 4.0

I need to display the .NET Compact Framework version number on the screen. I am using .NET CF 2.0 with Windows CE 4.0.

到目前为止,我已经完全忽略了版本号。我是否需要添加任何大会?我该如何找回它编程?

So far, I have been ignoring the version number completely. Do I need to add anything to the assembly? how do I retrieve it programmatically?

不幸的是,这并不适用的 Compact Framework的的。该 Application.ProductVersion 属性不Compact Framework的存在。你的答案的最新部分适用,但。

Unfortunately this does not apply to Compact Framework. The Application.ProductVersion property doesn't exist in Compact Framework. The latest part of your answer applies though.

还有一个问题: 做这些特性(主要,次要,建立,修订版)获得自动增加或对它们进行设置,每当我想?我看到它的方式,修改应自动递增每个新版本。

One more question: do these properties (major, minor, build, revision) get incremented automatically or do I set them whenever I want to? The way I see it, the revision should be automatically incremented with each new build.

推荐答案

System.Reflection.Assembly.GetExecutingAssembly()的GetName()。Version.Major System.Reflection.Assembly.GetExecutingAssembly()的GetName()。Version.Minor System.Reflection.Assembly.GetExecutingAssembly()的GetName()。Version.Build System.Reflection.Assembly.GetExecutingAssembly()的GetName()。Version.Revision

System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision

来源:http://msdn.microsoft.com/en-us/library/system.version.aspx

(编辑)

Application.ProductVersion地产

Application.ProductVersion Property

获取与此应用程序关联的产品版本。

Gets the product version associated with this application.

不具备的紧凑型框架,但System.Reflection.Assembly.GetExecutingAssembly()的GetName()版本。的

Not Available In Compact Framework But System.Reflection.Assembly.GetExecutingAssembly().GetName().Version Is.

来源:http://msdn.microsoft.com/en-us/library/system.windows.forms.application.productversion.aspx