Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve the time the application was built

I've been learning vb.net coming from a c++ background and am currently working on a simple server-client project as a console application.

I am looking to change the console's title to reflect the date/time the application was built, something similar to this:

- Crysis Wars Master Server - Dec 28 2014 (16:20)

or from the question I linked below:

enter image description here

I have an identical question but for C++, with the answer being:

...time of built is provided by the __TIME__ macro. In your example they also use __DATE__ macro which provides the date.

Obviously VB.NET is an entirely different programming language and for that reason the __TIME__ and __DATE__ macros cannot be used.

I found the solution to retrieve the date the application was built in C#, which also works for VB.NET:

File.GetCreationTime(Assembly.GetExecutingAssembly().Location)

..but however couldn't find anything to retrieve the time the application was built.

Is this possible? If so, how can I retrieve the time the application was built?

I also do not want to input the date/time manually, and as I said in my other question:

This would have many advantages, including easy identification of different builds of the application.

I also do not use the 'standard' way of incrementing the version of my applications, so I cannot use the way Jeff Atwood uses in his blog.

like image 557
AStopher Avatar asked Dec 12 '25 21:12

AStopher


1 Answers

Since at Managing Versions article of MSDN You can see that all values obtained while working with versions are obtained from XML files that store them, and there's no time values, I almost sure to say that It's not possible to get it easy.

However, using as you said File Class:

Dim fecha As Date = IO.File.GetCreationTime(Assembly.GetExecutingAssembly().Location)

MessageBox.Show(fecha.TimeOfDay().ToString)

Hope It's what you're looking for.

like image 111
Btc Sources Avatar answered Dec 14 '25 17:12

Btc Sources



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!