<pre>regKey = Registry.CurrentUser.OpenSubKey("Systemfiles");//subkeyname if (regKey == null) { regKey = Registry.CurrentUser.CreateSubKey("Systemfiles"); regKey.SetValue("tere", Encrypt("4/16/2017")); } else { regKey = Registry.CurrentUser.OpenSubKey("Systemfiles");//subkeyname string decryptDateValue = Decrypt(regKey.GetValue("tere").ToString()); //Keyname DateTime mainDate = Convert.ToDateTime(decryptDateValue); DateTime expiringDate = mainDate.AddDays(1); if (mainDate > expiringDate) { expire = true; } else { //Continue execution } }
DateTime expiringDate = mainDate.AddDays(1); if (mainDate > expiringDate)
expiringDate = mainDate + 1 day
expiringDate
if (DateTime.Now() > expiringDate)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)