How to put the build date of application somewhere in the application?

后端 未结 4 1956
南旧
南旧 2020-12-28 09:39

I would like to put the date the application was built somewhere in the application. Say the about box. Any ideas how this can be done? I need to do this for C# but I am als

4条回答
  •  没有蜡笔的小新
    2020-12-28 10:11

    The third number of the assembly version is a julian date with 0=1 Jan 2000 if you're using [assembly: AssemblyVersion("1.0.*")]

    e.g.

    DateTime buildDate = new DateTime(2000,1,1).AddDays(
      System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build
     );
    

提交回复
热议问题