I know I can add a version number to the "help" menu
application.pruductversion
but I do not know how I can add the date when the application was published
If you want to display the build date of your assembly this should do it in the most cases:
public static DateTime GetBuildDate()
{
UriBuilder uri = new UriBuilder(Assembly.GetExecutingAssembly().CodeBase);
return File.GetLastWriteTime(
Path.GetDirectoryName(Uri.UnescapeDataString(uri.Path))
);
}
There's also another way determining the real compile/build date "the hard way" here on SO:
Use AssemblyInfo file, for more information: AssemblyInfo on MSDN
If you are looking for adding a version number into the add/remove programs menu, you need to modify the msi file using something like SuperOrca or programmatically using something like Phavant MSI (google it)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With