Displaying the build date

前端 未结 25 2066
感动是毒
感动是毒 2020-11-22 11:36

I currently have an app displaying the build number in its title window. That\'s well and good except it means nothing to most of the users, who want to know if they have t

25条回答
  •  长发绾君心
    2020-11-22 12:12

    Add below to pre-build event command line:

    echo %date% %time% > "$(ProjectDir)\Resources\BuildDate.txt"
    

    Add this file as resource, now you have 'BuildDate' string in your resources.

    After inserting the file into the Resource (as public text file), I accessed it via

    string strCompTime = Properties.Resources.BuildDate;
    

    To create resources, see How to create and use resources in .NET.

提交回复
热议问题