C# put date into program when compiled

前端 未结 7 1502
感情败类
感情败类 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:28

    Precompilation directives are your key here. You could create a constant in your application and have it set when you compile.

    Make sure you obfuscate your code, however. Someone could disassemble it easily and tamper with the constant. Another solution is to have your software "phone home" to register itself. That way, the registration info is stored on your server and not their machine. There are also third party packages that perform the same security as you're looking for, but they are expensive!

提交回复
热议问题