/// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { string dateInString = "04.10.2011"; //this date will be extracted from the registry when program was installed DateTime startDate = DateTime.Parse(dateInString); DateTime expiryDate = startDate.AddDays(30); if (DateTime.Now > expiryDate) { DialogResult LicenseAgreement = MessageBox.Show("Do you acknowledge the EULA?" + "\n This message will appear every 30 days", "End User License Agreement", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (LicenseAgreement == DialogResult.No) { MessageBox.Show("The program will exit now then"); Application.ExitThread(); } else { RunProgram run = new RunProgram(); } } else { RunProgram run = new RunProgram(); } } private class RunProgram { public RunProgram() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)