开发者

how do I add a Publish date to a project I'm publishing in vs2010?

开发者 https://www.devze.com 2023-02-05 17:05 出处:网络
I know I can add a version numberto the \"help\" menu appl开发者_如何学Pythonication.pruductversion

I know I can add a version number to the "help" menu

appl开发者_如何学Pythonication.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:

  • Displaying the build date


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消