How to set an expiry date on a program

C#
if (DateTime.Now >= new DateTime(2020, 12, 31))
{
MessageBox.Show("Program Expired - Contact Administrator", "Program Name", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
Source

Also in C#: