把构建日期在关于对话框 [英] put build date in about box

查看:128
本文介绍了把构建日期在关于对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与关于框一个C#WinForms应用程序。我现在用把版本号在关于对话框:

I have a C# WinForms app with an About box. I am putting the version number in the about box using:

FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location)
    .FileVersion

这最终让我从中可执行建Subversion的版本号。

This ends up giving me the Subversion revision number from which the executable was built.

我也想拿到构建在日期到关于框。我想:

I would also like to get the date of the build into the About box. I tried:

File.GetLastWriteTime(Assembly.GetEntryAssembly().Location)

但是,这给我的可执行文件,只对应日时,应用程序是的安装(我们是在写日期使用ClickOnce)不是的内置

But that gives me the write date of the executable, which only corresponds to the date when the app was installed (we are using ClickOnce) not built.

我怎样才能在生产日期

推荐答案

如果您使用自动版本,您可以将版本号的最后两位转换为构建日期:的 MSDN

If you use automatic versioning, you can convert the last two bits of the version number into a build date: MSDN

这篇关于把构建日期在关于对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆