开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜