获取上次构建日期以显示最新版本日期 [英] Get last build date to display latest version date

查看:153
本文介绍了获取上次构建日期以显示最新版本日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我需要在我的应用程序中显示上次发布的版本日期。我将上一个构建/编译日期显示为版本日期,代码如下。



Hello,

I need to display last released version date in my application. I am displaying last build/compiled date as version date with below code.

DateTime buildDate = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
lbldate.Text = buildDate.Date.ToString("dd/MM/yyyy");





但如果我更新除了今天以外的最新代码的实时服务器,然后它显示我们用最新代码更新服务器的日期,而不是最后构建/编译日期。



另一个que ,代码是否在实时服务器上编译?这就是显示该日期的原因。


有没有办法显示上次构建/编译日期作为发布日期?



谢谢,

KK



but if I update the live server with latest code other than today, then it is displaying the date when we update the server with latest code instead last build/compiled date.

one another que, Is code compile on live server? that's why it is displaying that date.

is there any way to display last build/compiled date as release date?

Thanks,
KK

推荐答案

价值你正在阅读的是操作系统的最后修改时间,没有连接到构建日期!

程序集确实包含构建日期,但它不公开,并且没有简单的方法来检索它。 。

但是很难...... [ ^ ]



恕我直言 - 您最好使用版本号...
The value you are reading is the last modification time of the OS, not connected to the build date!
The assembly do contain the build date, but it's not public and there is no easy way to retrieve it...
but there is a hard...[^]

IMHO - you better use version number...


这篇关于获取上次构建日期以显示最新版本日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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