C# put date into program when compiled

前端 未结 7 1358
感情败类
感情败类 2021-01-12 23:49

I was thinking about how to create a program that would only be valid for X period of time, (within a C# app).

What I was thinking was that you would have the curren

相关标签:
7条回答
  • 2021-01-13 00:42

    From within your automated build process (you do use an automated build process, right?), had a simple app which generates a 1-line C# class

     public struct TimeLimit { public DateTime Date = new DateTime(2009,1,1); }
    

    changing the date automatically, and compile.

    Then just refer to TimeLimit.Date in your app.

    0 讨论(0)
提交回复
热议问题