How do I find the current time and date at compilation time in .net/C# application?

前端 未结 7 2178
孤城傲影
孤城傲影 2020-12-06 12:43

I want to include the current time and date in a .net application so I can include it in the start up log to show the user what version they have. Is it possible to retrieve

7条回答
  •  春和景丽
    2020-12-06 13:13

    You could update the Assembly version in AssemblyInfo.cs as part of your build. Then you could do something like this

    FileVersionInfo lvar = FileVersionInfo.GetVersionInfo(FileName);
    

    FileVersionInfo has the information (build/version,etc) that you looking for. See if this works out for you.

提交回复
热议问题