try this Code :)
DateTime GetLastExecutionDate()
{
RegistryKey rkey = Registry.CurrentUser;
RegistryKey rkey1 = rkey.OpenSubKey("software", true);
RegistryKey rkey2 = rkey1.CreateSubKey("tes");
DateTime lastDate = DateTime.Parse(rkey2.GetValue("LastDate").ToString());
return lastDate;
}
void AddLastExecutionDate()
{
RegistryKey rkey = Registry.CurrentUser;
RegistryKey rkey1 = rkey.OpenSubKey("software", true);
RegistryKey rkey2 = rkey1.CreateSubKey("tes");
rkey2.SetValue("LastDate", DateTime.Now.ToShortDateString());
}
this link will help for registry operations
Read, write and delete from registry with C#[
^]